LibreOffice Module vcl (master)  1
stacking.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/syswin.hxx>
21 #include <vcl/window.hxx>
22 #include <vcl/taskpanelist.hxx>
23 #include <sal/log.hxx>
24 
25 #include <salframe.hxx>
26 #include <salobj.hxx>
27 #include <svdata.hxx>
28 #include <window.h>
29 #include <brdwin.hxx>
30 
31 #include <com/sun/star/awt/XTopWindow.hpp>
32 
33 using namespace ::com::sun::star::uno;
34 using namespace ::com::sun::star::lang;
36 using namespace ::com::sun::star::datatransfer::dnd;
37 using namespace ::com::sun::star;
38 
39 using ::com::sun::star::awt::XTopWindow;
40 
42 {
43  std::unique_ptr<ImplCalcToTopData> mpNext;
45  std::unique_ptr<vcl::Region> mpInvalidateRegion;
46 };
47 
48 namespace vcl {
49 
51 {
52  vcl::Window *pTopmostParent = this;
53  while( pTopmostParent->ImplGetParent() )
54  pTopmostParent = pTopmostParent->ImplGetParent();
55  return pTopmostParent->mpWindowImpl->mpFrameWindow;
56 }
57 
59 {
60  mpWindowImpl->mpParent = pParent;
61  mpWindowImpl->mpRealParent = pParent;
62 
63  if ( pParent && !mpWindowImpl->mbFrame )
64  {
65  // search frame window and set window frame data
66  vcl::Window* pFrameParent = pParent->mpWindowImpl->mpFrameWindow;
67  mpWindowImpl->mpFrameData = pFrameParent->mpWindowImpl->mpFrameData;
68  if (mpWindowImpl->mpFrame != pFrameParent->mpWindowImpl->mpFrame)
69  {
70  mpWindowImpl->mpFrame = pFrameParent->mpWindowImpl->mpFrame;
71  if (mpWindowImpl->mpSysObj)
72  mpWindowImpl->mpSysObj->Reparent(mpWindowImpl->mpFrame);
73  }
74  mpWindowImpl->mpFrameWindow = pFrameParent;
75  mpWindowImpl->mbFrame = false;
76 
77  // search overlap window and insert window in list
78  if ( ImplIsOverlapWindow() )
79  {
80  vcl::Window* pFirstOverlapParent = pParent;
81  while ( !pFirstOverlapParent->ImplIsOverlapWindow() )
82  pFirstOverlapParent = pFirstOverlapParent->ImplGetParent();
83  mpWindowImpl->mpOverlapWindow = pFirstOverlapParent;
84 
85  mpWindowImpl->mpNextOverlap = mpWindowImpl->mpFrameData->mpFirstOverlap;
86  mpWindowImpl->mpFrameData->mpFirstOverlap = this;
87 
88  // Overlap-Windows are by default the uppermost
89  mpWindowImpl->mpNext = pFirstOverlapParent->mpWindowImpl->mpFirstOverlap;
90  pFirstOverlapParent->mpWindowImpl->mpFirstOverlap = this;
91  if ( !pFirstOverlapParent->mpWindowImpl->mpLastOverlap )
92  pFirstOverlapParent->mpWindowImpl->mpLastOverlap = this;
93  else
94  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = this;
95  }
96  else
97  {
98  if ( pParent->ImplIsOverlapWindow() )
99  mpWindowImpl->mpOverlapWindow = pParent;
100  else
101  mpWindowImpl->mpOverlapWindow = pParent->mpWindowImpl->mpOverlapWindow;
102  mpWindowImpl->mpPrev = pParent->mpWindowImpl->mpLastChild;
103  pParent->mpWindowImpl->mpLastChild = this;
104  if ( !pParent->mpWindowImpl->mpFirstChild )
105  pParent->mpWindowImpl->mpFirstChild = this;
106  else
107  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
108  }
109  }
110 }
111 
112 void Window::ImplRemoveWindow( bool bRemoveFrameData )
113 {
114  // remove window from the lists
115  if ( !mpWindowImpl->mbFrame )
116  {
117  if ( ImplIsOverlapWindow() )
118  {
119  if ( mpWindowImpl->mpFrameData->mpFirstOverlap.get() == this )
120  mpWindowImpl->mpFrameData->mpFirstOverlap = mpWindowImpl->mpNextOverlap;
121  else
122  {
123  vcl::Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
124  while ( pTempWin->mpWindowImpl->mpNextOverlap.get() != this )
125  pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
126  pTempWin->mpWindowImpl->mpNextOverlap = mpWindowImpl->mpNextOverlap;
127  }
128 
129  if ( mpWindowImpl->mpPrev )
130  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
131  else
132  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = mpWindowImpl->mpNext;
133  if ( mpWindowImpl->mpNext )
134  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
135  else
136  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
137  }
138  else
139  {
140  if ( mpWindowImpl->mpPrev )
141  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
142  else if ( mpWindowImpl->mpParent )
143  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = mpWindowImpl->mpNext;
144  if ( mpWindowImpl->mpNext )
145  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
146  else if ( mpWindowImpl->mpParent )
147  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = mpWindowImpl->mpPrev;
148  }
149 
150  mpWindowImpl->mpPrev = nullptr;
151  mpWindowImpl->mpNext = nullptr;
152  }
153 
154  if ( bRemoveFrameData )
155  {
156  // release the graphic
157  OutputDevice *pOutDev = GetOutDev();
158  pOutDev->ReleaseGraphics();
159  }
160 }
161 
162 void Window::reorderWithinParent(sal_uInt16 nNewPosition)
163 {
164  sal_uInt16 nChildCount = 0;
165  vcl::Window *pSource = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
166  while (pSource)
167  {
168  if (nChildCount == nNewPosition)
169  break;
170  pSource = pSource->mpWindowImpl->mpNext;
171  nChildCount++;
172  }
173 
174  if (pSource == this) //already at the right place
175  return;
176 
177  ImplRemoveWindow(false);
178 
179  if (pSource)
180  {
181  mpWindowImpl->mpNext = pSource;
182  mpWindowImpl->mpPrev = pSource->mpWindowImpl->mpPrev;
183  pSource->mpWindowImpl->mpPrev = this;
184  }
185  else
186  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = this;
187 
188  if (mpWindowImpl->mpPrev)
189  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
190  else
191  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = this;
192 }
193 
194 void Window::ImplToBottomChild()
195 {
196  if ( !ImplIsOverlapWindow() && !mpWindowImpl->mbReallyVisible && (mpWindowImpl->mpParent->mpWindowImpl->mpLastChild.get() != this) )
197  {
198  // put the window to the end of the list
199  if ( mpWindowImpl->mpPrev )
200  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
201  else
202  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = mpWindowImpl->mpNext;
203  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
204  mpWindowImpl->mpPrev = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild;
205  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = this;
206  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
207  mpWindowImpl->mpNext = nullptr;
208  }
209 }
210 
211 void Window::ImplCalcToTop( ImplCalcToTopData* pPrevData )
212 {
213  SAL_WARN_IF( !ImplIsOverlapWindow(), "vcl", "Window::ImplCalcToTop(): Is not an OverlapWindow" );
214 
215  if ( !mpWindowImpl->mbFrame )
216  {
217  if ( IsReallyVisible() )
218  {
219  // calculate region, where the window overlaps with other windows
220  Point aPoint( mnOutOffX, mnOutOffY );
221  vcl::Region aRegion( tools::Rectangle( aPoint,
222  Size( mnOutWidth, mnOutHeight ) ) );
223  vcl::Region aInvalidateRegion;
224  ImplCalcOverlapRegionOverlaps( aRegion, aInvalidateRegion );
225 
226  if ( !aInvalidateRegion.IsEmpty() )
227  {
229  pPrevData->mpNext.reset(pData);
230  pData->mpWindow = this;
231  pData->mpInvalidateRegion.reset(new vcl::Region( aInvalidateRegion ));
232  }
233  }
234  }
235 }
236 
237 void Window::ImplToTop( ToTopFlags nFlags )
238 {
239  SAL_WARN_IF( !ImplIsOverlapWindow(), "vcl", "Window::ImplToTop(): Is not an OverlapWindow" );
240 
241  if ( mpWindowImpl->mbFrame )
242  {
243  // on a mouse click in the external window, it is the latter's
244  // responsibility to assure our frame is put in front
245  if ( !mpWindowImpl->mpFrameData->mbHasFocus &&
246  !mpWindowImpl->mpFrameData->mbSysObjFocus &&
247  !mpWindowImpl->mpFrameData->mbInSysObjFocusHdl &&
248  !mpWindowImpl->mpFrameData->mbInSysObjToTopHdl )
249  {
250  // do not bring floating windows on the client to top
251  if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) )
252  {
254  if ( nFlags & ToTopFlags::RestoreWhenMin )
255  nSysFlags |= SalFrameToTop::RestoreWhenMin;
256  if ( nFlags & ToTopFlags::ForegroundTask )
257  nSysFlags |= SalFrameToTop::ForegroundTask;
258  if ( nFlags & ToTopFlags::GrabFocusOnly )
259  nSysFlags |= SalFrameToTop::GrabFocusOnly;
260  mpWindowImpl->mpFrame->ToTop( nSysFlags );
261  }
262  }
263  }
264  else
265  {
266  if ( mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap.get() != this )
267  {
268  // remove window from the list
269  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
270  if ( mpWindowImpl->mpNext )
271  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
272  else
273  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
274 
275  // take AlwaysOnTop into account
276  bool bOnTop = IsAlwaysOnTopEnabled();
277  vcl::Window* pNextWin = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
278  if ( !bOnTop )
279  {
280  while ( pNextWin )
281  {
282  if ( !pNextWin->IsAlwaysOnTopEnabled() )
283  break;
284  pNextWin = pNextWin->mpWindowImpl->mpNext;
285  }
286  }
287 
288  // add the window to the list again
289  mpWindowImpl->mpNext = pNextWin;
290  if ( pNextWin )
291  {
292  mpWindowImpl->mpPrev = pNextWin->mpWindowImpl->mpPrev;
293  pNextWin->mpWindowImpl->mpPrev = this;
294  }
295  else
296  {
297  mpWindowImpl->mpPrev = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap;
298  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = this;
299  }
300  if ( mpWindowImpl->mpPrev )
301  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
302  else
303  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = this;
304 
305  // recalculate ClipRegion of this and all overlapping windows
306  if ( IsReallyVisible() )
307  {
308  mpWindowImpl->mpOverlapWindow->ImplSetClipFlagOverlapWindows();
309  }
310  }
311  }
312 }
313 
314 void Window::ImplStartToTop( ToTopFlags nFlags )
315 {
316  ImplCalcToTopData aStartData;
317  ImplCalcToTopData* pCurData;
318  vcl::Window* pOverlapWindow;
319  if ( ImplIsOverlapWindow() )
320  pOverlapWindow = this;
321  else
322  pOverlapWindow = mpWindowImpl->mpOverlapWindow;
323 
324  // first calculate paint areas
325  vcl::Window* pTempOverlapWindow = pOverlapWindow;
326  aStartData.mpNext = nullptr;
327  pCurData = &aStartData;
328  do
329  {
330  pTempOverlapWindow->ImplCalcToTop( pCurData );
331  if ( pCurData->mpNext )
332  pCurData = pCurData->mpNext.get();
333  pTempOverlapWindow = pTempOverlapWindow->mpWindowImpl->mpOverlapWindow;
334  }
335  while ( !pTempOverlapWindow->mpWindowImpl->mbFrame );
336  // next calculate the paint areas of the ChildOverlap windows
337  pTempOverlapWindow = mpWindowImpl->mpFirstOverlap;
338  while ( pTempOverlapWindow )
339  {
340  pTempOverlapWindow->ImplCalcToTop( pCurData );
341  if ( pCurData->mpNext )
342  pCurData = pCurData->mpNext.get();
343  pTempOverlapWindow = pTempOverlapWindow->mpWindowImpl->mpNext;
344  }
345 
346  // and next change the windows list
347  pTempOverlapWindow = pOverlapWindow;
348  do
349  {
350  pTempOverlapWindow->ImplToTop( nFlags );
351  pTempOverlapWindow = pTempOverlapWindow->mpWindowImpl->mpOverlapWindow;
352  }
353  while ( !pTempOverlapWindow->mpWindowImpl->mbFrame );
354  // as last step invalidate the invalid areas
355  pCurData = aStartData.mpNext.get();
356  while ( pCurData )
357  {
359  pCurData = pCurData->mpNext.get();
360  }
361 }
362 
363 void Window::ImplFocusToTop( ToTopFlags nFlags, bool bReallyVisible )
364 {
365  // do we need to fetch the focus?
366  if ( !(nFlags & ToTopFlags::NoGrabFocus) )
367  {
368  // first window with GrabFocus-Activate gets the focus
369  vcl::Window* pFocusWindow = this;
370  while ( !pFocusWindow->ImplIsOverlapWindow() )
371  {
372  // if the window has no BorderWindow, we
373  // should always find the belonging BorderWindow
374  if ( !pFocusWindow->mpWindowImpl->mpBorderWindow )
375  {
376  if ( pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus )
377  break;
378  }
379  pFocusWindow = pFocusWindow->ImplGetParent();
380  }
381  if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus) &&
382  !pFocusWindow->HasChildPathFocus( true ) )
383  pFocusWindow->GrabFocus();
384  }
385 
386  if ( bReallyVisible )
387  ImplGenerateMouseMove();
388 }
389 
390 void Window::ImplShowAllOverlaps()
391 {
392  vcl::Window* pOverlapWindow = mpWindowImpl->mpFirstOverlap;
393  while ( pOverlapWindow )
394  {
395  if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
396  {
397  pOverlapWindow->Show( true, ShowFlags::NoActivate );
398  pOverlapWindow->mpWindowImpl->mbOverlapVisible = false;
399  }
400 
401  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
402  }
403 }
404 
405 void Window::ImplHideAllOverlaps()
406 {
407  vcl::Window* pOverlapWindow = mpWindowImpl->mpFirstOverlap;
408  while ( pOverlapWindow )
409  {
410  if ( pOverlapWindow->IsVisible() )
411  {
412  pOverlapWindow->mpWindowImpl->mbOverlapVisible = true;
413  pOverlapWindow->Show( false );
414  }
415 
416  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
417  }
418 }
419 
420 void Window::ToTop( ToTopFlags nFlags )
421 {
422  if (!mpWindowImpl)
423  return;
424 
425  ImplStartToTop( nFlags );
426  ImplFocusToTop( nFlags, IsReallyVisible() );
427 }
428 
429 void Window::SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags )
430 {
431 
432  if ( mpWindowImpl->mpBorderWindow )
433  {
434  mpWindowImpl->mpBorderWindow->SetZOrder( pRefWindow, nFlags );
435  return;
436  }
437 
438  if ( nFlags & ZOrderFlags::First )
439  {
440  if ( ImplIsOverlapWindow() )
441  pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
442  else
443  pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
444  nFlags |= ZOrderFlags::Before;
445  }
446  else if ( nFlags & ZOrderFlags::Last )
447  {
448  if ( ImplIsOverlapWindow() )
449  pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap;
450  else
451  pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild;
452  nFlags |= ZOrderFlags::Behind;
453  }
454 
455  while ( pRefWindow && pRefWindow->mpWindowImpl->mpBorderWindow )
456  pRefWindow = pRefWindow->mpWindowImpl->mpBorderWindow;
457  if (!pRefWindow || pRefWindow == this || mpWindowImpl->mbFrame)
458  return;
459 
460  SAL_WARN_IF( pRefWindow->mpWindowImpl->mpParent != mpWindowImpl->mpParent, "vcl", "Window::SetZOrder() - pRefWindow has other parent" );
461  if ( nFlags & ZOrderFlags::Before )
462  {
463  if ( pRefWindow->mpWindowImpl->mpPrev.get() == this )
464  return;
465 
466  if ( ImplIsOverlapWindow() )
467  {
468  if ( mpWindowImpl->mpPrev )
469  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
470  else
471  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = mpWindowImpl->mpNext;
472  if ( mpWindowImpl->mpNext )
473  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
474  else
475  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
476  if ( !pRefWindow->mpWindowImpl->mpPrev )
477  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = this;
478  }
479  else
480  {
481  if ( mpWindowImpl->mpPrev )
482  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
483  else
484  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = mpWindowImpl->mpNext;
485  if ( mpWindowImpl->mpNext )
486  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
487  else
488  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = mpWindowImpl->mpPrev;
489  if ( !pRefWindow->mpWindowImpl->mpPrev )
490  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = this;
491  }
492 
493  mpWindowImpl->mpPrev = pRefWindow->mpWindowImpl->mpPrev;
494  mpWindowImpl->mpNext = pRefWindow;
495  if ( mpWindowImpl->mpPrev )
496  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
497  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = this;
498  }
499  else if ( nFlags & ZOrderFlags::Behind )
500  {
501  if ( pRefWindow->mpWindowImpl->mpNext.get() == this )
502  return;
503 
504  if ( ImplIsOverlapWindow() )
505  {
506  if ( mpWindowImpl->mpPrev )
507  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
508  else
509  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = mpWindowImpl->mpNext;
510  if ( mpWindowImpl->mpNext )
511  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
512  else
513  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
514  if ( !pRefWindow->mpWindowImpl->mpNext )
515  mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = this;
516  }
517  else
518  {
519  if ( mpWindowImpl->mpPrev )
520  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext;
521  else
522  mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = mpWindowImpl->mpNext;
523  if ( mpWindowImpl->mpNext )
524  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev;
525  else
526  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = mpWindowImpl->mpPrev;
527  if ( !pRefWindow->mpWindowImpl->mpNext )
528  mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = this;
529  }
530 
531  mpWindowImpl->mpPrev = pRefWindow;
532  mpWindowImpl->mpNext = pRefWindow->mpWindowImpl->mpNext;
533  if ( mpWindowImpl->mpNext )
534  mpWindowImpl->mpNext->mpWindowImpl->mpPrev = this;
535  mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
536  }
537 
538  if ( IsReallyVisible() )
539  {
540  if ( mpWindowImpl->mbInitWinClipRegion || !mpWindowImpl->maWinClipRegion.IsEmpty() )
541  {
542  bool bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
543  ImplSetClipFlag();
544 
545  // When ClipRegion was not initialised, assume
546  // the window has not been sent, therefore do not
547  // trigger any Invalidates. This is an optimization
548  // for HTML documents with many controls. If this
549  // check gives problems, a flag should be introduced
550  // which tracks whether the window has already been
551  // emitted after Show
552  if ( !bInitWinClipRegion )
553  {
554  // Invalidate all windows which are next to each other
555  // Is INCOMPLETE !!!
556  tools::Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
557  vcl::Window* pWindow = nullptr;
558  if ( ImplIsOverlapWindow() )
559  {
560  if ( mpWindowImpl->mpOverlapWindow )
561  pWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
562  }
563  else
564  pWindow = ImplGetParent()->mpWindowImpl->mpFirstChild;
565  // Invalidate all windows in front of us and which are covered by us
566  while ( pWindow )
567  {
568  if ( pWindow == this )
569  break;
570  tools::Rectangle aCompRect( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ),
571  Size( pWindow->mnOutWidth, pWindow->mnOutHeight ) );
572  if ( aWinRect.IsOver( aCompRect ) )
574  pWindow = pWindow->mpWindowImpl->mpNext;
575  }
576 
577  // If we are covered by a window in the background
578  // we should redraw it
579  while ( pWindow )
580  {
581  if ( pWindow != this )
582  {
583  tools::Rectangle aCompRect( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ),
584  Size( pWindow->mnOutWidth, pWindow->mnOutHeight ) );
585  if ( aWinRect.IsOver( aCompRect ) )
586  {
588  break;
589  }
590  }
591  pWindow = pWindow->mpWindowImpl->mpNext;
592  }
593  }
594  }
595  }
596 }
597 
598 void Window::EnableAlwaysOnTop( bool bEnable )
599 {
600 
601  mpWindowImpl->mbAlwaysOnTop = bEnable;
602 
603  if ( mpWindowImpl->mpBorderWindow )
604  mpWindowImpl->mpBorderWindow->EnableAlwaysOnTop( bEnable );
605  else if ( bEnable && IsReallyVisible() )
606  ToTop();
607 
608  if ( mpWindowImpl->mbFrame )
609  mpWindowImpl->mpFrame->SetAlwaysOnTop( bEnable );
610 }
611 
612 bool Window::IsTopWindow() const
613 {
614  if ( !mpWindowImpl || mpWindowImpl->mbInDispose )
615  return false;
616 
617  // topwindows must be frames or they must have a borderwindow which is a frame
618  if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) )
619  return false;
620 
621  ImplGetWinData();
622  if( mpWindowImpl->mpWinData->mnIsTopWindow == sal_uInt16(~0)) // still uninitialized
623  {
624  // #113722#, cache result of expensive queryInterface call
625  vcl::Window *pThisWin = const_cast<vcl::Window*>(this);
626  uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
627  pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
628  }
629  return mpWindowImpl->mpWinData->mnIsTopWindow == 1;
630 }
631 
632 vcl::Window* Window::FindWindow( const Point& rPos ) const
633 {
634 
635  Point aPos = OutputToScreenPixel( rPos );
636  return const_cast<vcl::Window*>(this)->ImplFindWindow( aPos );
637 }
638 
639 vcl::Window* Window::ImplFindWindow( const Point& rFramePos )
640 {
641  vcl::Window* pTempWindow;
642  vcl::Window* pFindWindow;
643 
644  // first check all overlapping windows
645  pTempWindow = mpWindowImpl->mpFirstOverlap;
646  while ( pTempWindow )
647  {
648  pFindWindow = pTempWindow->ImplFindWindow( rFramePos );
649  if ( pFindWindow )
650  return pFindWindow;
651  pTempWindow = pTempWindow->mpWindowImpl->mpNext;
652  }
653 
654  // then we check our window
655  if ( !mpWindowImpl->mbVisible )
656  return nullptr;
657 
658  WindowHitTest nHitTest = ImplHitTest( rFramePos );
659  if ( nHitTest & WindowHitTest::Inside )
660  {
661  // and then we check all child windows
662  pTempWindow = mpWindowImpl->mpFirstChild;
663  while ( pTempWindow )
664  {
665  pFindWindow = pTempWindow->ImplFindWindow( rFramePos );
666  if ( pFindWindow )
667  return pFindWindow;
668  pTempWindow = pTempWindow->mpWindowImpl->mpNext;
669  }
670 
671  if ( nHitTest & WindowHitTest::Transparent )
672  return nullptr;
673  else
674  return this;
675  }
676 
677  return nullptr;
678 }
679 
680 bool Window::ImplIsRealParentPath( const vcl::Window* pWindow ) const
681 {
682  pWindow = pWindow->GetParent();
683  while ( pWindow )
684  {
685  if ( pWindow == this )
686  return true;
687  pWindow = pWindow->GetParent();
688  }
689 
690  return false;
691 }
692 
693 bool Window::ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow ) const
694 {
695  do
696  {
697  if ( !bSystemWindow && pWindow->ImplIsOverlapWindow() )
698  break;
699 
700  pWindow = pWindow->ImplGetParent();
701 
702  if ( pWindow == this )
703  return true;
704  }
705  while ( pWindow );
706 
707  return false;
708 }
709 
710 bool Window::ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow ) const
711 {
712  if ( this == pWindow )
713  return true;
714  return ImplIsChild( pWindow, bSystemWindow );
715 }
716 
717 void Window::ImplResetReallyVisible()
718 {
719  bool bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
720 
721  mbDevOutput = false;
722  mpWindowImpl->mbReallyVisible = false;
723  mpWindowImpl->mbReallyShown = false;
724 
725  // the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
726  // For this, the data member of the event must not be NULL.
727  // Previously, we did this in Window::Show, but there some events got lost in certain situations.
728  if( bBecameReallyInvisible && ImplIsAccessibleCandidate() )
729  CallEventListeners( VclEventId::WindowHide, this );
730  // TODO. It's kind of a hack that we're re-using the VclEventId::WindowHide. Normally, we should
731  // introduce another event which explicitly triggers the Accessibility implementations.
732 
733  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
734  while ( pWindow )
735  {
736  if ( pWindow->mpWindowImpl->mbReallyVisible )
737  pWindow->ImplResetReallyVisible();
738  pWindow = pWindow->mpWindowImpl->mpNext;
739  }
740 
741  pWindow = mpWindowImpl->mpFirstChild;
742  while ( pWindow )
743  {
744  if ( pWindow->mpWindowImpl->mbReallyVisible )
745  pWindow->ImplResetReallyVisible();
746  pWindow = pWindow->mpWindowImpl->mpNext;
747  }
748 }
749 
750 void Window::ImplUpdateWindowPtr( vcl::Window* pWindow )
751 {
752  if ( mpWindowImpl->mpFrameWindow != pWindow->mpWindowImpl->mpFrameWindow )
753  {
754  // release graphic
755  OutputDevice *pOutDev = GetOutDev();
756  pOutDev->ReleaseGraphics();
757  }
758 
759  mpWindowImpl->mpFrameData = pWindow->mpWindowImpl->mpFrameData;
760  if (mpWindowImpl->mpFrame != pWindow->mpWindowImpl->mpFrame)
761  {
762  mpWindowImpl->mpFrame = pWindow->mpWindowImpl->mpFrame;
763  if (mpWindowImpl->mpSysObj)
764  mpWindowImpl->mpSysObj->Reparent(mpWindowImpl->mpFrame);
765  }
766  mpWindowImpl->mpFrameWindow = pWindow->mpWindowImpl->mpFrameWindow;
767  if ( pWindow->ImplIsOverlapWindow() )
768  mpWindowImpl->mpOverlapWindow = pWindow;
769  else
770  mpWindowImpl->mpOverlapWindow = pWindow->mpWindowImpl->mpOverlapWindow;
771 
772  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
773  while ( pChild )
774  {
775  pChild->ImplUpdateWindowPtr( pWindow );
776  pChild = pChild->mpWindowImpl->mpNext;
777  }
778 }
779 
780 void Window::ImplUpdateWindowPtr()
781 {
782  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
783  while ( pChild )
784  {
785  pChild->ImplUpdateWindowPtr( this );
786  pChild = pChild->mpWindowImpl->mpNext;
787  }
788 }
789 
790 void Window::ImplUpdateOverlapWindowPtr( bool bNewFrame )
791 {
792  bool bVisible = IsVisible();
793  Show( false );
794  ImplRemoveWindow( bNewFrame );
795  vcl::Window* pRealParent = mpWindowImpl->mpRealParent;
796  ImplInsertWindow( ImplGetParent() );
797  mpWindowImpl->mpRealParent = pRealParent;
798  ImplUpdateWindowPtr();
799  if ( ImplUpdatePos() )
800  ImplUpdateSysObjPos();
801 
802  if ( bNewFrame )
803  {
804  vcl::Window* pOverlapWindow = mpWindowImpl->mpFirstOverlap;
805  while ( pOverlapWindow )
806  {
807  vcl::Window* pNextOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
808  pOverlapWindow->ImplUpdateOverlapWindowPtr( bNewFrame );
809  pOverlapWindow = pNextOverlapWindow;
810  }
811  }
812 
813  if ( bVisible )
814  Show();
815 }
816 
817 SystemWindow* Window::GetSystemWindow() const
818 {
819 
820  const vcl::Window* pWin = this;
821  while ( pWin && !pWin->IsSystemWindow() )
822  pWin = pWin->GetParent();
823  return static_cast<SystemWindow*>(const_cast<Window*>(pWin));
824 }
825 
827 {
828  // get the most top-level system window, the one that contains the taskpanelist
829  SystemWindow *pSysWin = nullptr;
830  if( !pWin )
831  return pSysWin;
832  vcl::Window *pMyParent = pWin;
833  while ( pMyParent )
834  {
835  if ( pMyParent->IsSystemWindow() )
836  pSysWin = static_cast<SystemWindow*>(pMyParent);
837  pMyParent = pMyParent->GetParent();
838  }
839  return pSysWin;
840 }
841 
842 void Window::SetParent( vcl::Window* pNewParent )
843 {
844  SAL_INFO_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" );
845  SAL_WARN_IF( pNewParent == this, "vcl", "someone tried to reparent a window to itself" );
846 
847  if( !pNewParent || pNewParent == this )
848  return;
849 
850  // check if the taskpanelist would change and move the window pointer accordingly
851  SystemWindow *pSysWin = ImplGetLastSystemWindow(this);
852  SystemWindow *pNewSysWin = nullptr;
853  bool bChangeTaskPaneList = false;
854  if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) )
855  {
856  pNewSysWin = ImplGetLastSystemWindow( pNewParent );
857  if( pNewSysWin && pNewSysWin != pSysWin )
858  {
859  bChangeTaskPaneList = true;
860  pSysWin->GetTaskPaneList()->RemoveWindow( this );
861  }
862  }
863  // remove ownerdraw decorated windows from list in the top-most frame window
864  if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame )
865  {
866  ::std::vector< VclPtr<vcl::Window> >& rList = ImplGetOwnerDrawList();
867  auto p = ::std::find( rList.begin(), rList.end(), VclPtr<vcl::Window>(this) );
868  if( p != rList.end() )
869  rList.erase( p );
870  }
871 
872  ImplSetFrameParent( pNewParent );
873 
874  if ( mpWindowImpl->mpBorderWindow )
875  {
876  mpWindowImpl->mpRealParent = pNewParent;
877  mpWindowImpl->mpBorderWindow->SetParent( pNewParent );
878  return;
879  }
880 
881  if ( mpWindowImpl->mpParent.get() == pNewParent )
882  return;
883 
884  if ( mpWindowImpl->mbFrame )
885  mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
886 
887  bool bVisible = IsVisible();
888  Show( false, ShowFlags::NoFocusChange );
889 
890  // check if the overlap window changes
891  vcl::Window* pOldOverlapWindow;
892  vcl::Window* pNewOverlapWindow = nullptr;
893  if ( ImplIsOverlapWindow() )
894  pOldOverlapWindow = nullptr;
895  else
896  {
897  pNewOverlapWindow = pNewParent->ImplGetFirstOverlapWindow();
898  if ( mpWindowImpl->mpOverlapWindow.get() != pNewOverlapWindow )
899  pOldOverlapWindow = mpWindowImpl->mpOverlapWindow;
900  else
901  pOldOverlapWindow = nullptr;
902  }
903 
904  // convert windows in the hierarchy
905  bool bFocusOverlapWin = HasChildPathFocus( true );
906  bool bFocusWin = HasChildPathFocus();
907  bool bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
908  if ( bNewFrame )
909  {
910  if ( mpWindowImpl->mpFrameData->mpFocusWin )
911  {
912  if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpFocusWin ) )
913  mpWindowImpl->mpFrameData->mpFocusWin = nullptr;
914  }
915  if ( mpWindowImpl->mpFrameData->mpMouseMoveWin )
916  {
917  if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpMouseMoveWin ) )
918  mpWindowImpl->mpFrameData->mpMouseMoveWin = nullptr;
919  }
920  if ( mpWindowImpl->mpFrameData->mpMouseDownWin )
921  {
922  if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpMouseDownWin ) )
923  mpWindowImpl->mpFrameData->mpMouseDownWin = nullptr;
924  }
925  }
926  ImplRemoveWindow( bNewFrame );
927  ImplInsertWindow( pNewParent );
928  if ( mpWindowImpl->mnParentClipMode & ParentClipMode::Clip )
929  pNewParent->mpWindowImpl->mbClipChildren = true;
930  ImplUpdateWindowPtr();
931  if ( ImplUpdatePos() )
932  ImplUpdateSysObjPos();
933 
934  // If the Overlap-Window has changed, we need to test whether
935  // OverlapWindows that had the Child window as their parent
936  // need to be put into the window hierarchy.
937  if ( ImplIsOverlapWindow() )
938  {
939  if ( bNewFrame )
940  {
941  vcl::Window* pOverlapWindow = mpWindowImpl->mpFirstOverlap;
942  while ( pOverlapWindow )
943  {
944  vcl::Window* pNextOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
945  pOverlapWindow->ImplUpdateOverlapWindowPtr( bNewFrame );
946  pOverlapWindow = pNextOverlapWindow;
947  }
948  }
949  }
950  else if ( pOldOverlapWindow )
951  {
952  // reset Focus-Save
953  if ( bFocusWin ||
954  (pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow &&
955  IsWindowOrChild( pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow )) )
956  pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
957 
958  vcl::Window* pOverlapWindow = pOldOverlapWindow->mpWindowImpl->mpFirstOverlap;
959  while ( pOverlapWindow )
960  {
961  vcl::Window* pNextOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
962  if ( ImplIsRealParentPath( pOverlapWindow->ImplGetWindow() ) )
963  pOverlapWindow->ImplUpdateOverlapWindowPtr( bNewFrame );
964  pOverlapWindow = pNextOverlapWindow;
965  }
966 
967  // update activate-status at next overlap window
968  if ( HasChildPathFocus( true ) )
969  ImplCallFocusChangeActivate( pNewOverlapWindow, pOldOverlapWindow );
970  }
971 
972  // also convert Activate-Status
973  if ( bNewFrame )
974  {
975  if ( (GetType() == WindowType::BORDERWINDOW) &&
976  (ImplGetWindow()->GetType() == WindowType::FLOATINGWINDOW) )
977  static_cast<ImplBorderWindow*>(this)->SetDisplayActive( mpWindowImpl->mpFrameData->mbHasFocus );
978  }
979 
980  // when required give focus to new frame if
981  // FocusWindow is changed with SetParent()
982  if ( bFocusOverlapWin )
983  {
984  mpWindowImpl->mpFrameData->mpFocusWin = Application::GetFocusWindow();
985  if ( !mpWindowImpl->mpFrameData->mbHasFocus )
986  {
987  mpWindowImpl->mpFrame->ToTop( SalFrameToTop::NONE );
988  }
989  }
990 
991  // Assure DragSource and DropTarget members are created
992  if ( bNewFrame )
993  {
994  GetDropTarget();
995  }
996 
997  if( bChangeTaskPaneList )
998  pNewSysWin->GetTaskPaneList()->AddWindow( this );
999 
1000  if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame )
1001  ImplGetOwnerDrawList().emplace_back(this );
1002 
1003  if ( bVisible )
1005 }
1006 
1007 bool Window::IsAncestorOf( const vcl::Window& rWindow ) const
1008 {
1009  return ImplIsRealParentPath(&rWindow);
1010 }
1011 
1012 sal_uInt16 Window::GetChildCount() const
1013 {
1014  if (!mpWindowImpl)
1015  return 0;
1016 
1017  sal_uInt16 nChildCount = 0;
1018  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
1019  while ( pChild )
1020  {
1021  nChildCount++;
1022  pChild = pChild->mpWindowImpl->mpNext;
1023  }
1024 
1025  return nChildCount;
1026 }
1027 
1028 vcl::Window* Window::GetChild( sal_uInt16 nChild ) const
1029 {
1030  if (!mpWindowImpl)
1031  return nullptr;
1032 
1033  sal_uInt16 nChildCount = 0;
1034  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
1035  while ( pChild )
1036  {
1037  if ( nChild == nChildCount )
1038  return pChild;
1039  pChild = pChild->mpWindowImpl->mpNext;
1040  nChildCount++;
1041  }
1042 
1043  return nullptr;
1044 }
1045 
1046 vcl::Window* Window::GetWindow( GetWindowType nType ) const
1047 {
1048  if (!mpWindowImpl)
1049  return nullptr;
1050 
1051  switch ( nType )
1052  {
1053  case GetWindowType::Parent:
1054  return mpWindowImpl->mpRealParent;
1055 
1057  return mpWindowImpl->mpFirstChild;
1058 
1060  return mpWindowImpl->mpLastChild;
1061 
1062  case GetWindowType::Prev:
1063  return mpWindowImpl->mpPrev;
1064 
1065  case GetWindowType::Next:
1066  return mpWindowImpl->mpNext;
1067 
1069  return mpWindowImpl->mpFirstOverlap;
1070 
1072  if ( ImplIsOverlapWindow() )
1073  return const_cast<vcl::Window*>(this);
1074  else
1075  return mpWindowImpl->mpOverlapWindow;
1076 
1078  if ( ImplIsOverlapWindow() )
1079  return mpWindowImpl->mpOverlapWindow;
1080  else
1081  return mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpOverlapWindow;
1082 
1083  case GetWindowType::Client:
1084  return this->ImplGetWindow();
1085 
1087  return ImplGetParent();
1088 
1089  case GetWindowType::Frame:
1090  return mpWindowImpl->mpFrameWindow;
1091 
1092  case GetWindowType::Border:
1093  if ( mpWindowImpl->mpBorderWindow )
1094  return mpWindowImpl->mpBorderWindow->GetWindow( GetWindowType::Border );
1095  return const_cast<vcl::Window*>(this);
1096 
1098  return ImplGetWinData()->maTopWindowChildren.empty() ? nullptr : (*ImplGetWinData()->maTopWindowChildren.begin()).get();
1099 
1101  {
1102  if ( !mpWindowImpl->mpRealParent )
1103  return nullptr;
1104  const ::std::list< VclPtr<vcl::Window> >& rTopWindows( mpWindowImpl->mpRealParent->ImplGetWinData()->maTopWindowChildren );
1105  ::std::list< VclPtr<vcl::Window> >::const_iterator myPos =
1106  ::std::find( rTopWindows.begin(), rTopWindows.end(), this );
1107  if ( ( myPos == rTopWindows.end() ) || ( ++myPos == rTopWindows.end() ) )
1108  return nullptr;
1109  return *myPos;
1110  }
1111 
1112  }
1113 
1114  return nullptr;
1115 }
1116 
1117 bool Window::IsChild( const vcl::Window* pWindow ) const
1118 {
1119  do
1120  {
1121  if ( pWindow->ImplIsOverlapWindow() )
1122  break;
1123 
1124  pWindow = pWindow->ImplGetParent();
1125 
1126  if ( pWindow == this )
1127  return true;
1128  }
1129  while ( pWindow );
1130 
1131  return false;
1132 }
1133 
1134 bool Window::IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow ) const
1135 {
1136 
1137  if ( this == pWindow )
1138  return true;
1139  return ImplIsChild( pWindow, bSystemWindow );
1140 }
1141 
1142 void Window::ImplSetFrameParent( const vcl::Window* pParent )
1143 {
1145  while( pFrameWindow )
1146  {
1147  // search all frames that are children of this window
1148  // and reparent them
1149  if( ImplIsRealParentPath( pFrameWindow ) )
1150  {
1151  SAL_WARN_IF( mpWindowImpl->mpFrame == pFrameWindow->mpWindowImpl->mpFrame, "vcl", "SetFrameParent to own" );
1152  SAL_WARN_IF( !mpWindowImpl->mpFrame, "vcl", "no frame" );
1153  SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : nullptr;
1154  pFrameWindow->mpWindowImpl->mpFrame->SetParent( pParentFrame );
1155  }
1156  pFrameWindow = pFrameWindow->mpWindowImpl->mpFrameData->mpNextFrame;
1157  }
1158 }
1159 
1160 } /* namespace vcl */
1161 
1162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPRIVATE vcl::Window * ImplFindWindow(const Point &rFramePos)
Definition: stacking.cxx:639
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:835
bool bVisible
WindowHitTest
Definition: window.hxx:434
SAL_DLLPRIVATE void ImplUpdateWindowPtr(vcl::Window *pWindow)
Definition: stacking.cxx:750
std::unique_ptr< ContentProperties > pData
VclPtr< vcl::Window > mpWindow
Definition: stacking.cxx:44
#define SAL_INFO_IF(condition, area, stream)
SAL_DLLPRIVATE void ImplToTop(ToTopFlags nFlags)
Definition: stacking.cxx:237
ZOrderFlags
Definition: window.hxx:173
bool IsOver(const tools::Rectangle &rRect) const
SAL_DLLPRIVATE void ImplInsertWindow(vcl::Window *pParent)
Definition: stacking.cxx:58
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3005
GetWindowType
Definition: window.hxx:121
SAL_DLLPRIVATE void ImplInvalidateFrameRegion(const vcl::Region *pRegion, InvalidateFlags nFlags)
Definition: paint.cxx:682
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:921
WinBits const WB_OWNERDRAWDECORATION
virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3137
void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition)
Definition: builder.cxx:2530
std::unique_ptr< vcl::Region > mpInvalidateRegion
Definition: stacking.cxx:45
SAL_DLLPRIVATE void ImplRemoveWindow(bool bRemoveFrameData)
Definition: stacking.cxx:112
WinBits const WB_SYSTEMFLOATWIN
if(nullptr==pCandidateA||nullptr==pCandidateB)
bool IsAlwaysOnTopEnabled() const
Definition: window2.cxx:1138
SalFrameToTop
Definition: salframe.hxx:43
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
bool IsEmpty() const
Definition: region.cxx:228
bool IsSystemWindow() const
Definition: window2.cxx:992
void SetParent(vcl::Window *pNewParent)
Definition: stacking.cxx:842
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1160
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:511
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:865
static SystemWindow * ImplGetLastSystemWindow(vcl::Window *pWin)
Definition: stacking.cxx:826
void GrabFocus()
Definition: window.cxx:2977
vcl::Window * GetParent() const
Definition: window2.cxx:1092
SAL_DLLPRIVATE vcl::Window * ImplGetTopmostFrameWindow()
Definition: stacking.cxx:50
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
Definition: window2.cxx:880
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
static vcl::Window * GetFocusWindow()
Get the currently focused window.
Definition: svapp.cxx:1045
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
Definition: syswin.cxx:1007
while(true)
virtual void ReleaseGraphics(bool bRelease=true)=0
Release the graphics device, and remove it from the graphics device list.
std::unique_ptr< ImplCalcToTopData > mpNext
Definition: stacking.cxx:43
SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr(bool bNewFrame)
Definition: stacking.cxx:790
SAL_DLLPRIVATE void ImplCalcToTop(ImplCalcToTopData *pPrevData)
Definition: stacking.cxx:211
#define SAL_WARN_IF(condition, area, stream)
ImplSVFrameData maFrameData
Definition: svdata.hxx:357
bool IsVisible() const
Definition: window2.cxx:1097
SAL_DLLPRIVATE void ImplResetReallyVisible()
Definition: stacking.cxx:717
void * p
void RemoveWindow(vcl::Window *pWindow)
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:200
void AddWindow(vcl::Window *pWindow)
TaskPaneList * GetTaskPaneList()
Definition: syswin.cxx:242
ToTopFlags
Definition: window.hxx:198
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2151