LibreOffice Module vcl (master)  1
syswin.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 <memory>
21 
22 #include <o3tl/safeint.hxx>
23 #include <sal/config.h>
24 #include <sal/log.hxx>
25 
26 #include <vcl/layout.hxx>
27 #include <vcl/mnemonic.hxx>
28 #include <vcl/settings.hxx>
29 #include <vcl/svapp.hxx>
30 #include <vcl/menu.hxx>
31 #include <vcl/event.hxx>
32 #include <vcl/syswin.hxx>
33 #include <vcl/taskpanelist.hxx>
34 #include <vcl/tabctrl.hxx>
35 #include <vcl/tabpage.hxx>
36 #include <vcl/virdev.hxx>
37 
38 #include <rtl/strbuf.hxx>
39 
40 #include <accel.hxx>
41 #include <salframe.hxx>
42 #include <svdata.hxx>
43 #include <brdwin.hxx>
44 #include <window.h>
45 
46 using namespace ::com::sun::star::uno;
47 using namespace ::com::sun::star::lang;
48 
50 {
51 public:
52  ImplData();
53 
54  std::unique_ptr<TaskPaneList>
57  OUString maRepresentedURL;
59 };
60 
62 {
63  mpTaskPaneList = nullptr;
64  maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
65 }
66 
67 SystemWindow::SystemWindow(WindowType nType, const char* pIdleDebugName)
68  : Window(nType)
69  , mbDockBtn(false)
70  , mbHideBtn(false)
71  , mbSysChild(false)
73  , mbPaintComplete(false)
75  , mnIcon(0)
76  , mpImplData(new ImplData)
77  , maLayoutIdle( pIdleDebugName )
78  , mbIsDeferredInit(false)
79 {
80  mpWindowImpl->mbSysWin = true;
82 
83  //To-Do, reuse maResizeTimer
85  maLayoutIdle.SetInvokeHandler( LINK( this, SystemWindow, ImplHandleLayoutTimerHdl ) );
86 }
87 
88 void SystemWindow::loadUI(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
89  const css::uno::Reference<css::frame::XFrame> &rFrame)
90 {
91  mbIsDeferredInit = true;
92  mpDialogParent = pParent; //should be unset in doDeferredInit
93  m_pUIBuilder.reset( new VclBuilder(this, AllSettings::GetUIRootDir(), rUIXMLDescription, rID, rFrame) );
94 }
95 
97 {
98  disposeOnce();
99 }
100 
102 {
103  maLayoutIdle.Stop();
104  mpImplData.reset();
105 
106  // Hack to make sure code called from base ~Window does not interpret this
107  // as a SystemWindow (which it no longer is by then):
108  mpWindowImpl->mbSysWin = false;
109  disposeBuilder();
111  mpMenuBar.clear();
112  Window::dispose();
113 }
114 
115 static void ImplHandleControlAccelerator( const vcl::Window* pWindow, bool bShow )
116 {
117  Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow());
118  if (pControl && pControl->GetText().indexOf('~') != -1)
119  {
120  pControl->SetShowAccelerator( bShow );
122  }
123 }
124 
125 namespace
126 {
127  void processChildren(const vcl::Window *pParent, bool bShowAccel)
128  {
129  // go through its children
130  vcl::Window* pChild = firstLogicalChildOfParent(pParent);
131  while (pChild)
132  {
133  if (pChild->GetType() == WindowType::TABCONTROL)
134  {
135  // find currently shown tab page
136  TabControl* pTabControl = static_cast<TabControl*>(pChild);
137  TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
138  processChildren(pTabPage, bShowAccel);
139  }
140  else if (pChild->GetType() == WindowType::TABPAGE)
141  {
142  // bare tabpage without tabcontrol parent (options dialog)
143  processChildren(pChild, bShowAccel);
144  }
145  else if ((pChild->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL)
146  {
147  // special controls that manage their children outside of widget layout
148  processChildren(pChild, bShowAccel);
149  }
150  else
151  {
152  ImplHandleControlAccelerator(pChild, bShowAccel);
153  }
154  pChild = nextLogicalChildOfParent(pParent, pChild);
155  }
156  }
157 }
158 
159 namespace
160 {
161  bool ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, const vcl::Window *pWindow)
162  {
164  {
165  const CommandModKeyData *pCData = rCEvent.GetModKeyData();
166  const bool bShowAccel = pCData && pCData->IsMod2() && pCData->IsDown();
167  processChildren(pWindow, bShowAccel);
168  return true;
169  }
170  return false;
171  }
172 }
173 
175 {
176  if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
177  ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this);
178 
179  // capture KeyEvents for menu handling
180  if (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT)
181  {
182  MenuBar* pMBar = mpMenuBar;
183  if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) )
184  {
186  if( pWin && pWin->IsSystemWindow() )
187  pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar();
188  }
189  if (pMBar && pMBar->ImplHandleKeyEvent(*rNEvt.GetKeyEvent()))
190  return true;
191  }
192 
193  return Window::EventNotify( rNEvt );
194 }
195 
197 {
198  // capture KeyEvents for taskpane cycling
199  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
200  {
201  if( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F6 &&
202  rNEvt.GetKeyEvent()->GetKeyCode().IsMod1() &&
203  !rNEvt.GetKeyEvent()->GetKeyCode().IsShift() )
204  {
205  // Ctrl-F6 goes directly to the document
207  return true;
208  }
209  else
210  {
211  TaskPaneList *pTList = mpImplData->mpTaskPaneList.get();
212  if( !pTList && ( GetType() == WindowType::FLOATINGWINDOW ) )
213  {
215  if( pWin && pWin->IsSystemWindow() )
216  pTList = static_cast<SystemWindow*>(pWin)->mpImplData->mpTaskPaneList.get();
217  }
218  if( !pTList )
219  {
220  // search topmost system window which is the one to handle dialog/toolbar cycling
221  SystemWindow *pSysWin = this;
222  vcl::Window *pWin = this;
223  while( pWin )
224  {
225  pWin = pWin->GetParent();
226  if( pWin && pWin->IsSystemWindow() )
227  pSysWin = static_cast<SystemWindow*>(pWin);
228  }
229  pTList = pSysWin->mpImplData->mpTaskPaneList.get();
230  }
231  if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
232  return true;
233  }
234  }
235  return Window::PreNotify( rNEvt );
236 }
237 
239 {
240  if( !mpImplData )
241  return nullptr;
242  if( mpImplData->mpTaskPaneList )
243  return mpImplData->mpTaskPaneList.get();
244  else
245  {
246  mpImplData->mpTaskPaneList.reset( new TaskPaneList );
247  MenuBar* pMBar = mpMenuBar;
248  if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) )
249  {
251  if ( pWin && pWin->IsSystemWindow() )
252  pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar();
253  }
254  if( pMBar )
255  mpImplData->mpTaskPaneList->AddWindow( pMBar->ImplGetWindow() );
256  return mpImplData->mpTaskPaneList.get();
257  }
258 }
259 
261 {
262  VclPtr<vcl::Window> xWindow = this;
264  if ( xWindow->isDisposed() )
265  return false;
266 
267  if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
268  return false;
269 
270  // Is Window not closeable, ignore close
271  vcl::Window* pBorderWin = ImplGetBorderWindow();
272  WinBits nStyle;
273  if ( pBorderWin )
274  nStyle = pBorderWin->GetStyle();
275  else
276  nStyle = GetStyle();
277  if ( !(nStyle & WB_CLOSEABLE) )
278  return false;
279 
280  Hide();
281 
282  return true;
283 }
284 
286 {
287 }
288 
290 {
291 }
292 
293 void SystemWindow::SetRepresentedURL( const OUString& i_rURL )
294 {
295  bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
296  mpImplData->maRepresentedURL = i_rURL;
297  if ( !mbSysChild && bChanged )
298  {
299  const vcl::Window* pWindow = this;
300  while ( pWindow->mpWindowImpl->mpBorderWindow )
301  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
302 
303  if ( pWindow->mpWindowImpl->mbFrame )
304  pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
305  }
306 }
307 
308 void SystemWindow::SetIcon( sal_uInt16 nIcon )
309 {
310  if ( mnIcon == nIcon )
311  return;
312 
313  mnIcon = nIcon;
314 
315  if ( !mbSysChild )
316  {
317  const vcl::Window* pWindow = this;
318  while ( pWindow->mpWindowImpl->mpBorderWindow )
319  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
320 
321  if ( pWindow->mpWindowImpl->mbFrame )
322  pWindow->mpWindowImpl->mpFrame->SetIcon( nIcon );
323  }
324 }
325 
326 void SystemWindow::ShowTitleButton( TitleButton nButton, bool bVisible )
327 {
328  if ( nButton == TitleButton::Docking )
329  {
330  if ( mbDockBtn != bVisible )
331  {
332  mbDockBtn = bVisible;
333  if ( mpWindowImpl->mpBorderWindow )
334  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetDockButton( bVisible );
335  }
336  }
337  else if ( nButton == TitleButton::Hide )
338  {
339  if ( mbHideBtn != bVisible )
340  {
341  mbHideBtn = bVisible;
342  if ( mpWindowImpl->mpBorderWindow )
343  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetHideButton( bVisible );
344  }
345  }
346  else if ( nButton == TitleButton::Menu )
347  {
348  if ( mpWindowImpl->mpBorderWindow )
349  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuButton( bVisible );
350  }
351  else
352  return;
353 }
354 
356 {
357  if ( nButton == TitleButton::Docking )
358  return mbDockBtn;
359  else /* if ( nButton == TitleButton::Hide ) */
360  return mbHideBtn;
361 }
362 
364 {
365  maMinOutSize = rSize;
366  if ( mpWindowImpl->mpBorderWindow )
367  {
368  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMinOutputSize( rSize.Width(), rSize.Height() );
369  if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
370  mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
371  }
372  else if ( mpWindowImpl->mbFrame )
373  mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
374 }
375 
377 {
378  Size aSize( rSize );
379  if( aSize.Width() > SHRT_MAX || aSize.Width() <= 0 )
380  aSize.setWidth( SHRT_MAX );
381  if( aSize.Height() > SHRT_MAX || aSize.Height() <= 0 )
382  aSize.setHeight( SHRT_MAX );
383 
384  mpImplData->maMaxOutSize = aSize;
385  if ( mpWindowImpl->mpBorderWindow )
386  {
387  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMaxOutputSize( aSize.Width(), aSize.Height() );
388  if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
389  mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
390  }
391  else if ( mpWindowImpl->mbFrame )
392  mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
393 }
394 
396 {
397  return mpImplData->maMaxOutSize;
398 }
399 
401  const OString& rStr)
402 {
404  sal_Int32 nIndex = 0;
405 
406  OString aTokenStr = rStr.getToken(0, ',', nIndex);
407  if (!aTokenStr.isEmpty())
408  {
409  rData.SetX(aTokenStr.toInt32());
410  if( rData.GetX() > -16384 && rData.GetX() < 16384 )
411  nValidMask |= WindowStateMask::X;
412  else
413  rData.SetX( 0 );
414  }
415  else
416  rData.SetX( 0 );
417  aTokenStr = rStr.getToken(0, ',', nIndex);
418  if (!aTokenStr.isEmpty())
419  {
420  rData.SetY(aTokenStr.toInt32());
421  if( rData.GetY() > -16384 && rData.GetY() < 16384 )
422  nValidMask |= WindowStateMask::Y;
423  else
424  rData.SetY( 0 );
425  }
426  else
427  rData.SetY( 0 );
428  aTokenStr = rStr.getToken(0, ',', nIndex);
429  if (!aTokenStr.isEmpty())
430  {
431  rData.SetWidth(aTokenStr.toInt32());
432  if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
433  nValidMask |= WindowStateMask::Width;
434  else
435  rData.SetWidth( 0 );
436  }
437  else
438  rData.SetWidth( 0 );
439  aTokenStr = rStr.getToken(0, ';', nIndex);
440  if (!aTokenStr.isEmpty())
441  {
442  rData.SetHeight(aTokenStr.toInt32());
443  if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
444  nValidMask |= WindowStateMask::Height;
445  else
446  rData.SetHeight( 0 );
447  }
448  else
449  rData.SetHeight( 0 );
450  aTokenStr = rStr.getToken(0, ';', nIndex);
451  if (!aTokenStr.isEmpty())
452  {
453  // #94144# allow Minimize again, should be masked out when read from configuration
454  // 91625 - ignore Minimize
455  WindowStateState nState = static_cast<WindowStateState>(aTokenStr.toInt32());
456  //nState &= ~(WindowStateState::Minimized);
457  rData.SetState( nState );
458  nValidMask |= WindowStateMask::State;
459  }
460  else
462 
463  // read maximized pos/size
464  aTokenStr = rStr.getToken(0, ',', nIndex);
465  if (!aTokenStr.isEmpty())
466  {
467  rData.SetMaximizedX(aTokenStr.toInt32());
468  if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
469  nValidMask |= WindowStateMask::MaximizedX;
470  else
471  rData.SetMaximizedX( 0 );
472  }
473  else
474  rData.SetMaximizedX( 0 );
475  aTokenStr = rStr.getToken(0, ',', nIndex);
476  if (!aTokenStr.isEmpty())
477  {
478  rData.SetMaximizedY(aTokenStr.toInt32());
479  if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
480  nValidMask |= WindowStateMask::MaximizedY;
481  else
482  rData.SetMaximizedY( 0 );
483  }
484  else
485  rData.SetMaximizedY( 0 );
486  aTokenStr = rStr.getToken(0, ',', nIndex);
487  if (!aTokenStr.isEmpty())
488  {
489  rData.SetMaximizedWidth(aTokenStr.toInt32());
490  if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
491  nValidMask |= WindowStateMask::MaximizedWidth;
492  else
493  rData.SetMaximizedWidth( 0 );
494  }
495  else
496  rData.SetMaximizedWidth( 0 );
497  aTokenStr = rStr.getToken(0, ';', nIndex);
498  if (!aTokenStr.isEmpty())
499  {
500  rData.SetMaximizedHeight(aTokenStr.toInt32());
501  if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
502  nValidMask |= WindowStateMask::MaximizedHeight;
503  else
504  rData.SetMaximizedHeight( 0 );
505  }
506  else
507  rData.SetMaximizedHeight( 0 );
508 
509  // mark valid fields
510  rData.SetMask( nValidMask );
511 }
512 
513 OString WindowStateData::ToStr() const
514 {
515  const WindowStateMask nValidMask = GetMask();
516  if ( nValidMask == WindowStateMask::NONE )
517  return OString();
518 
519  OStringBuffer rStrBuf(64);
520 
521  if ( nValidMask & WindowStateMask::X )
522  rStrBuf.append(static_cast<sal_Int32>(GetX()));
523  rStrBuf.append(',');
524  if ( nValidMask & WindowStateMask::Y )
525  rStrBuf.append(static_cast<sal_Int32>(GetY()));
526  rStrBuf.append(',');
527  if ( nValidMask & WindowStateMask::Width )
528  rStrBuf.append(static_cast<sal_Int32>(GetWidth()));
529  rStrBuf.append(',');
530  if ( nValidMask & WindowStateMask::Height )
531  rStrBuf.append(static_cast<sal_Int32>(GetHeight()));
532  rStrBuf.append( ';' );
533  if ( nValidMask & WindowStateMask::State )
534  {
535  // #94144# allow Minimize again, should be masked out when read from configuration
536  // 91625 - ignore Minimize
538  rStrBuf.append(static_cast<sal_Int32>(nState));
539  }
540  rStrBuf.append(';');
541  if ( nValidMask & WindowStateMask::MaximizedX )
542  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedX()));
543  rStrBuf.append(',');
544  if ( nValidMask & WindowStateMask::MaximizedY )
545  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedY()));
546  rStrBuf.append( ',' );
547  if ( nValidMask & WindowStateMask::MaximizedWidth )
548  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedWidth()));
549  rStrBuf.append(',');
550  if ( nValidMask & WindowStateMask::MaximizedHeight )
551  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedHeight()));
552  rStrBuf.append(';');
553 
554  return rStrBuf.makeStringAndClear();
555 }
556 
557 void SystemWindow::ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin )
558 {
559  tools::Rectangle aScreenRect;
562  else
563  {
564  aScreenRect = Application::GetScreenPosSizePixel( 0 );
565  for( unsigned int i = 1; i < Application::GetScreenCount(); i++ )
566  aScreenRect.Union( Application::GetScreenPosSizePixel( i ) );
567  }
568  // unfortunately most of the time width and height are not really known
569  if( i_nWidth < 1 )
570  i_nWidth = 50;
571  if( i_nHeight < 1 )
572  i_nHeight = 50;
573 
574  // check left border
575  bool bMove = false;
576  if( io_rX + i_nWidth < aScreenRect.Left() )
577  {
578  bMove = true;
579  io_rX = aScreenRect.Left();
580  }
581  // check right border
582  if( io_rX > aScreenRect.Right() - i_nWidth )
583  {
584  bMove = true;
585  io_rX = aScreenRect.Right() - i_nWidth;
586  }
587  // check top border
588  if( io_rY + i_nHeight < aScreenRect.Top() )
589  {
590  bMove = true;
591  io_rY = aScreenRect.Top();
592  }
593  // check bottom border
594  if( io_rY > aScreenRect.Bottom() - i_nHeight )
595  {
596  bMove = true;
597  io_rY = aScreenRect.Bottom() - i_nHeight;
598  }
599  vcl::Window* pParent = i_pConfigureWin->GetParent();
600  if( bMove && pParent )
601  {
602  // calculate absolute screen pos here, since that is what is contained in WindowState
603  Point aParentAbsPos( pParent->OutputToAbsoluteScreenPixel( Point(0,0) ) );
604  Size aParentSizePixel( pParent->GetOutputSizePixel() );
605  Point aPos( (aParentSizePixel.Width() - i_nWidth) / 2,
606  (aParentSizePixel.Height() - i_nHeight) / 2 );
607  io_rX = aParentAbsPos.X() + aPos.X();
608  io_rY = aParentAbsPos.Y() + aPos.Y();
609  }
610 }
611 
613 {
614  const WindowStateMask nValidMask = rData.GetMask();
615  if ( nValidMask == WindowStateMask::NONE )
616  return;
617 
618  if ( mbSysChild )
619  return;
620 
621  vcl::Window* pWindow = this;
622  while ( pWindow->mpWindowImpl->mpBorderWindow )
623  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
624 
625  if ( pWindow->mpWindowImpl->mbFrame )
626  {
627  const WindowStateState nState = rData.GetState();
628  SalFrameState aState;
629  aState.mnMask = rData.GetMask();
630  aState.mnX = rData.GetX();
631  aState.mnY = rData.GetY();
632  aState.mnWidth = rData.GetWidth();
633  aState.mnHeight = rData.GetHeight();
634 
636  {
637  // #i43799# adjust window state sizes if a minimal output size was set
638  // otherwise the frame and the client might get different sizes
639  if( maMinOutSize.Width() > aState.mnWidth )
640  aState.mnWidth = maMinOutSize.Width();
641  if( maMinOutSize.Height() > aState.mnHeight )
642  aState.mnHeight = maMinOutSize.Height();
643  }
644 
645  aState.mnMaximizedX = rData.GetMaximizedX();
646  aState.mnMaximizedY = rData.GetMaximizedY();
647  aState.mnMaximizedWidth = rData.GetMaximizedWidth();
648  aState.mnMaximizedHeight = rData.GetMaximizedHeight();
649  // #94144# allow Minimize again, should be masked out when read from configuration
650  // 91625 - ignore Minimize
651  //nState &= ~(WindowStateState::Minimized);
652  aState.mnState = nState & WindowStateState::SystemMask;
653 
654  // normalize window positions onto screen
655  ImplMoveToScreen( aState.mnX, aState.mnY, aState.mnWidth, aState.mnHeight, pWindow );
656  ImplMoveToScreen( aState.mnMaximizedX, aState.mnMaximizedY, aState.mnMaximizedWidth, aState.mnMaximizedHeight, pWindow );
657 
658  // #96568# avoid having multiple frames at the same screen location
659  // do the check only if not maximized
660  if( !((rData.GetMask() & WindowStateMask::State) && (nState & WindowStateState::Maximized)) )
662  {
664  ImplSVData *pSVData = ImplGetSVData();
665  vcl::Window *pWin = pSVData->maFrameData.mpFirstFrame;
666  bool bWrapped = false;
667  while( pWin )
668  {
669  if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
670  pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible )
671  {
672  SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry();
673  if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 )
674  {
675  tools::Long displacement = g.nTopDecoration ? g.nTopDecoration : 20;
676  if( static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() ||
677  static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() )
678  {
679  // displacing would leave screen
680  aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0)
681  aState.mnY = displacement;
682  if( bWrapped ||
683  static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() ||
684  static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() )
685  break; // further displacement not possible -> break
686  // avoid endless testing
687  bWrapped = true;
688  }
689  else
690  {
691  // displace
692  aState.mnX += displacement;
693  aState.mnY += displacement;
694  }
695  pWin = pSVData->maFrameData.mpFirstFrame; // check new pos again
696  }
697  }
698  pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
699  }
700  }
701 
702  mpWindowImpl->mpFrame->SetWindowState( &aState );
703 
704  // do a synchronous resize for layout reasons
705  // but use rData only when the window is not to be maximized (#i38089#)
706  // otherwise we have no useful size information
707  if( (rData.GetMask() & WindowStateMask::State) && (nState & WindowStateState::Maximized) )
708  {
709  // query maximized size from frame
710  SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
711 
712  // but use it only if it is different from the restore size (rData)
713  // as currently only on windows the exact size of a maximized window
714  // can be computed without actually showing the window
715  if( aGeometry.nWidth != rData.GetWidth() || aGeometry.nHeight != rData.GetHeight() )
716  ImplHandleResize( pWindow, aGeometry.nWidth, aGeometry.nHeight );
717  }
718  else
720  ImplHandleResize( pWindow, aState.mnWidth, aState.mnHeight ); // #i43799# use aState and not rData, see above
721  }
722  else
723  {
724  PosSizeFlags nPosSize = PosSizeFlags::NONE;
725  if ( nValidMask & WindowStateMask::X )
726  nPosSize |= PosSizeFlags::X;
727  if ( nValidMask & WindowStateMask::Y )
728  nPosSize |= PosSizeFlags::Y;
729  if ( nValidMask & WindowStateMask::Width )
730  nPosSize |= PosSizeFlags::Width;
731  if ( nValidMask & WindowStateMask::Height )
732  nPosSize |= PosSizeFlags::Height;
733 
734  tools::Long nX = rData.GetX();
735  tools::Long nY = rData.GetY();
736  tools::Long nWidth = rData.GetWidth();
737  tools::Long nHeight = rData.GetHeight();
738  const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
739  if( nX < 0 )
740  nX = 0;
741  if( nX + nWidth > static_cast<tools::Long>(rGeom.nWidth) )
742  nX = rGeom.nWidth - nWidth;
743  if( nY < 0 )
744  nY = 0;
745  if( nY + nHeight > static_cast<tools::Long>(rGeom.nHeight) )
746  nY = rGeom.nHeight - nHeight;
747  setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
748  }
749 }
750 
752 {
753  WindowStateMask nValidMask = rData.GetMask();
754  if ( nValidMask == WindowStateMask::NONE )
755  return;
756 
757  if ( mbSysChild )
758  return;
759 
760  const vcl::Window* pWindow = this;
761  while ( pWindow->mpWindowImpl->mpBorderWindow )
762  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
763 
764  if ( pWindow->mpWindowImpl->mbFrame )
765  {
766  SalFrameState aState;
767  aState.mnMask = WindowStateMask::All;
768  if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
769  {
770  if ( nValidMask & WindowStateMask::X )
771  rData.SetX( aState.mnX );
772  if ( nValidMask & WindowStateMask::Y )
773  rData.SetY( aState.mnY );
774  if ( nValidMask & WindowStateMask::Width )
775  rData.SetWidth( aState.mnWidth );
776  if ( nValidMask & WindowStateMask::Height )
777  rData.SetHeight( aState.mnHeight );
778  if ( aState.mnMask & WindowStateMask::MaximizedX )
779  {
780  rData.SetMaximizedX( aState.mnMaximizedX );
781  nValidMask |= WindowStateMask::MaximizedX;
782  }
783  if ( aState.mnMask & WindowStateMask::MaximizedY )
784  {
785  rData.SetMaximizedY( aState.mnMaximizedY );
786  nValidMask |= WindowStateMask::MaximizedY;
787  }
789  {
790  rData.SetMaximizedWidth( aState.mnMaximizedWidth );
791  nValidMask |= WindowStateMask::MaximizedWidth;
792  }
794  {
795  rData.SetMaximizedHeight( aState.mnMaximizedHeight );
796  nValidMask |= WindowStateMask::MaximizedHeight;
797  }
798  if ( nValidMask & WindowStateMask::State )
799  {
800  // #94144# allow Minimize again, should be masked out when read from configuration
801  // 91625 - ignore Minimize
802  if ( !(nValidMask&WindowStateMask::Minimized) )
804  rData.SetState( aState.mnState );
805  }
806  rData.SetMask( nValidMask );
807  }
808  else
810  }
811  else
812  {
813  Point aPos = GetPosPixel();
814  Size aSize = GetSizePixel();
816 
817  if ( nValidMask & WindowStateMask::X )
818  rData.SetX( aPos.X() );
819  if ( nValidMask & WindowStateMask::Y )
820  rData.SetY( aPos.Y() );
821  if ( nValidMask & WindowStateMask::Width )
822  rData.SetWidth( aSize.Width() );
823  if ( nValidMask & WindowStateMask::Height )
824  rData.SetHeight( aSize.Height() );
825  if ( nValidMask & WindowStateMask::State )
826  rData.SetState( nState );
827  }
828 }
829 
830 void SystemWindow::SetWindowState(const OString& rStr)
831 {
832  if (rStr.isEmpty())
833  return;
834 
836  ImplWindowStateFromStr( aData, rStr );
837  SetWindowStateData( aData );
838 }
839 
841 {
843  aData.SetMask( nMask );
844  GetWindowStateData( aData );
845 
846  return aData.ToStr();
847 }
848 
850 {
851  if ( mpMenuBar == pMenuBar )
852  return;
853 
854  MenuBar* pOldMenuBar = mpMenuBar;
855  vcl::Window* pOldWindow = nullptr;
856  VclPtr<vcl::Window> pNewWindow;
857  mpMenuBar = pMenuBar;
858 
859  if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
860  {
861  if ( pOldMenuBar )
862  pOldWindow = pOldMenuBar->ImplGetWindow();
863  else
864  pOldWindow = nullptr;
865  if ( pOldWindow )
866  {
867  CallEventListeners( VclEventId::WindowMenubarRemoved, static_cast<void*>(pOldMenuBar) );
868  pOldWindow->SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
869  }
870  if ( pMenuBar )
871  {
872  SAL_WARN_IF( pMenuBar->pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
873 
874  pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar);
875  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow);
876 
877  CallEventListeners( VclEventId::WindowMenubarAdded, static_cast<void*>(pMenuBar) );
878  }
879  else
880  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( nullptr );
882  if ( pOldMenuBar )
883  {
884  bool bDelete = (pMenuBar == nullptr);
885  if( bDelete && pOldWindow )
886  {
887  if( mpImplData->mpTaskPaneList )
888  mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
889  }
890  MenuBar::ImplDestroy( pOldMenuBar, bDelete );
891  if( bDelete )
892  pOldWindow = nullptr; // will be deleted in MenuBar::ImplDestroy,
893  }
894 
895  }
896  else
897  {
898  if( pMenuBar )
899  pNewWindow = pMenuBar->ImplGetWindow();
900  if( pOldMenuBar )
901  pOldWindow = pOldMenuBar->ImplGetWindow();
902  }
903 
904  // update taskpane list to make menubar accessible
905  if( mpImplData->mpTaskPaneList )
906  {
907  if( pOldWindow )
908  mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
909  if( pNewWindow )
910  mpImplData->mpTaskPaneList->AddWindow( pNewWindow );
911  }
912 }
913 
914 void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription,
915  const css::uno::Reference<css::frame::XFrame>& rFrame,
916  const NotebookBarAddonsItem& aNotebookBarAddonsItem,
917  bool bReloadNotebookbar)
918 {
919  if (rUIXMLDescription != maNotebookBarUIFile || bReloadNotebookbar)
920  {
921  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())
922  ->SetNotebookBar(rUIXMLDescription, rFrame, aNotebookBarAddonsItem);
923  maNotebookBarUIFile = rUIXMLDescription;
924  if(GetNotebookBar())
926  }
927 }
928 
930 {
931  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CloseNotebookBar();
932  maNotebookBarUIFile.clear();
933 }
934 
936 {
937  return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();
938 }
939 
941 {
942  if ( mnMenuBarMode != nMode )
943  {
944  mnMenuBarMode = nMode;
945  if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
946  {
947  if ( nMode == MenuBarMode::Hide )
948  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true );
949  else
950  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( false );
951  }
952  }
953 }
954 
956 {
957  if( mpImplData && mpImplData->mpTaskPaneList )
958  return mpImplData->mpTaskPaneList->IsInList( pWin );
959  return false;
960 }
961 
962 unsigned int SystemWindow::GetScreenNumber() const
963 {
964  return mpWindowImpl->mpFrame->maGeometry.nDisplayScreenNumber;
965 }
966 
967 void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen)
968 {
969  mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
970 }
971 
972 void SystemWindow::SetApplicationID(const OUString &rApplicationID)
973 {
974  mpWindowImpl->mpFrame->SetApplicationID( rApplicationID );
975 }
976 
978 {
979  mpImplData->maCloseHdl = rLink;
980 }
981 
983 {
984  return mpImplData->maCloseHdl;
985 }
986 
988 {
989  if (!isLayoutEnabled())
990  return;
992  return;
994  if (hasPendingLayout())
995  return;
997 }
998 
1000 {
1001  queue_resize();
1002 }
1003 
1005 {
1006  //pre dtor called, and single child is a container => we're layout enabled
1007  return mpImplData && ::isLayoutEnabled(this);
1008 }
1009 
1011 {
1012  if (!isLayoutEnabled())
1013  return Window::GetOptimalSize();
1014 
1016  // tdf#141318 Do the same as SystemWindow::setOptimalLayoutSize in case we're called before initial layout
1017  const_cast<SystemWindow*>(this)->settingOptimalLayoutSize(pBox);
1019 
1020  sal_Int32 nBorderWidth = get_border_width();
1021 
1022  aSize.AdjustHeight(2 * nBorderWidth );
1023  aSize.AdjustWidth(2 * nBorderWidth );
1024 
1025  return Window::CalcWindowSize(aSize);
1026 }
1027 
1029 {
1030  sal_Int32 nBorderWidth = get_border_width();
1031 
1032  aSize.AdjustWidth( -(2 * nBorderWidth) );
1033  aSize.AdjustHeight( -(2 * nBorderWidth) );
1034 
1035  Point aPos(nBorderWidth, nBorderWidth);
1037 }
1038 
1039 IMPL_LINK_NOARG( SystemWindow, ImplHandleLayoutTimerHdl, Timer*, void )
1040 {
1041  Window *pBox = GetWindow(GetWindowType::FirstChild);
1042  if (!isLayoutEnabled())
1043  {
1044  SAL_WARN_IF(pBox, "vcl.layout", "SystemWindow has become non-layout because extra children have been added directly to it.");
1045  return;
1046  }
1047  assert(pBox);
1048  setPosSizeOnContainee(GetSizePixel(), *pBox);
1049 }
1050 
1051 void SystemWindow::SetText(const OUString& rStr)
1052 {
1054  Window::SetText(rStr);
1055 }
1056 
1057 OUString SystemWindow::GetText() const
1058 {
1059  const_cast<SystemWindow*>(this)->setDeferredProperties();
1060  return Window::GetText();
1061 }
1062 
1064 {
1065 }
1066 
1068 {
1069  maLayoutIdle.Stop();
1070 
1071  //resize SystemWindow to fit requisition on initial show
1073 
1075 
1076  Size aSize = get_preferred_size();
1077 
1079 
1080  aSize.setWidth( std::min(aMax.Width(), aSize.Width()) );
1081  aSize.setHeight( std::min(aMax.Height(), aSize.Height()) );
1082 
1083  SetMinOutputSizePixel(aSize);
1084  SetSizePixel(aSize);
1085  setPosSizeOnContainee(aSize, *pBox);
1086 }
1087 
1089 {
1090  if (GetSettings().GetStyleSettings().GetAutoMnemonic())
1092 
1093  if (isLayoutEnabled())
1094  {
1099  }
1100 }
1101 
1103 {
1104  SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
1105 }
1106 
1108 {
1109  // same prerequisites as in Execute()
1112  Show();
1113  ToTop();
1114  ensureRepaint();
1115 
1116  Size aSize(GetOutputSizePixel());
1117 
1119  xOutput->SetOutputSizePixel(aSize);
1120 
1121  Point aPos;
1122  xOutput->DrawOutDev(aPos, aSize, aPos, aSize, *GetOutDev());
1123 
1124  return xOutput;
1125 }
1126 
1128 {
1129  Window::PrePaint(rRenderContext);
1130  mbPaintComplete = false;
1131 }
1132 
1134 {
1135  Window::PostPaint(rRenderContext);
1136  mbPaintComplete = true;
1137 }
1138 
1140 {
1141  // ensure repaint
1142  Invalidate();
1143  mbPaintComplete = false;
1144 
1145  while (!mbPaintComplete && !Application::IsQuit())
1146  {
1148  }
1149 }
1150 
1152 {
1153  if (MenuBar* pMenu = GetMenuBar())
1154  {
1155  sal_uInt16 nMenuItems = pMenu->GetItemCount();
1156  for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
1157  rMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
1158  }
1159 }
1160 
1162 {
1163  if (MenuBar* pMenuBar = GetMenuBar())
1164  return pMenuBar->GetMenuBarHeight();
1165  return 0;
1166 }
1167 
1168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
Definition: window.cxx:2791
unsigned int GetMaximizedHeight() const
Definition: windowstate.hxx:76
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:824
void setDeferredProperties()
Definition: dialog.cxx:1572
static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize)
Definition: layout.cxx:76
sal_Int32 nIndex
bool IsMod2() const
void loadUI(vcl::Window *pParent, const OString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >())
Definition: syswin.cxx:88
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:174
void setWidth(tools::Long nWidth)
WindowStateState mnState
Definition: salwtype.hxx:245
SAL_DLLPRIVATE void ensureRepaint()
Definition: syswin.cxx:1139
VclPtr< MenuBar > mpMenuBar
Definition: syswin.hxx:97
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:1639
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:332
OString GetWindowState(WindowStateMask nMask=WindowStateMask::All) const
Definition: syswin.cxx:840
virtual void ImplAdjustNWFSizes()
Definition: window3.cxx:28
void SetState(WindowStateState nState)
Definition: windowstate.hxx:67
WinBits const WB_NODIALOGCONTROL
constexpr tools::Long Left() const
int GetMenuBarHeight() const
Definition: syswin.cxx:1161
tools::Long mnMaximizedHeight
Definition: salwtype.hxx:243
OString ToStr() const
Definition: syswin.cxx:513
const Link< SystemWindow &, void > & GetCloseHdl() const
Definition: syswin.cxx:982
Resize runs before repaint, so we won't paint twice.
int GetY() const
Definition: windowstate.hxx:62
static Size getLayoutRequisition(const vcl::Window &rWindow)
Definition: layout.cxx:151
long Long
ImplSVNWFData maNWFData
Definition: svdata.hxx:402
void CollectMenuBarMnemonics(MnemonicGenerator &rMnemonicGenerator) const
Definition: syswin.cxx:1151
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:864
void InvalidateSizeCache()
clear OptimalSize cache
Definition: window2.cxx:1301
int GetX() const
Definition: windowstate.hxx:60
virtual Size GetSizePixel() const
Definition: window.cxx:2402
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:895
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1256
void ShowTitleButton(TitleButton nButton, bool bVisible)
Definition: syswin.cxx:326
TabPage * GetTabPage(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1892
WindowStateState GetState() const
Definition: windowstate.hxx:68
const Size & GetMaxOutputSizePixel() const
Definition: syswin.cxx:395
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area...
Definition: svapp.cxx:1232
VclPtr< VirtualDevice > createScreenshot()
Definition: syswin.cxx:1107
PosSizeFlags
Definition: window.hxx:125
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:316
std::unique_ptr< TaskPaneList > mpTaskPaneList
Definition: syswin.cxx:55
std::unique_ptr< ImplData > mpImplData
Definition: syswin.hxx:109
The invalidated area is updated immediately.
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2796
virtual void Resizing(Size &rSize)
Definition: syswin.cxx:289
bool IsDown() const
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox)
Definition: syswin.cxx:1028
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1231
unsigned int GetHeight() const
Definition: windowstate.hxx:66
const CommandModKeyData * GetModKeyData() const
void SetMaximizedWidth(unsigned int nRWidth)
Definition: windowstate.hxx:73
static SAL_DLLPRIVATE VclPtr< vcl::Window > ImplCreate(vcl::Window *pParent, vcl::Window *pWindow, MenuBar *pMenu)
Definition: menu.cxx:2483
unsigned int GetMaximizedWidth() const
Definition: windowstate.hxx:74
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1127
StateChangedType
Definition: window.hxx:289
constexpr tools::Long Width() const
sal_Int64 WinBits
tools::ULong nRightDecoration
Definition: salgeom.hxx:34
Size CalcOutputSize(const Size &rWinSz) const
Definition: window2.cxx:539
static void Yield()
Process the next event.
Definition: svapp.cxx:530
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar, etc.
Definition: builder.hxx:66
void SetMaximizedHeight(unsigned int nRHeight)
Definition: windowstate.hxx:75
void SetMaximizedX(int nRX)
Definition: windowstate.hxx:69
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
Definition: dialog.cxx:132
void Hide()
Definition: window.hxx:884
void SetSystemWindow(SystemWindow *pSystemWindow)
IMPL_LINK_NOARG(SystemWindow, ImplHandleLayoutTimerHdl, Timer *, void)
Definition: syswin.cxx:1039
unsigned int GetWidth() const
Definition: windowstate.hxx:64
WindowStateMask
Definition: vclenum.hxx:121
bool IsTopWindow() const
Definition: stacking.cxx:608
void CloseNotebookBar()
Definition: syswin.cxx:929
void SetCloseHdl(const Link< SystemWindow &, void > &rLink)
Definition: syswin.cxx:977
virtual OUString GetText() const
Definition: window.cxx:3055
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
Idle maLayoutIdle
Definition: syswin.hxx:110
VclPtr< NotebookBar > const & GetNotebookBar() const
Definition: syswin.cxx:935
Link< SystemWindow &, void > maCloseHdl
Definition: syswin.cxx:58
void SetRepresentedURL(const OUString &)
Definition: syswin.cxx:293
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem, bool bReloadNotebookbar=false)
Definition: syswin.cxx:914
tools::Long mnMaximizedX
Definition: salwtype.hxx:240
bool mbAutoAccel
Definition: svdata.hxx:338
constexpr OUStringLiteral aData
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
Definition: dialog.cxx:188
virtual bool Close()
Definition: syswin.cxx:260
void SetMinOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:363
static OUString GetUIRootDir()
Definition: dialog.cxx:556
WinBits const WB_DIALOGCONTROL
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
void SetIcon(sal_uInt16 nIcon)
Definition: syswin.cxx:308
void clear()
Definition: vclptr.hxx:190
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent &rKEvent)
Definition: menu.cxx:2520
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
Definition: svapp.cxx:1267
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:196
virtual void doDeferredInit(WinBits nBits)
Definition: syswin.cxx:1102
unsigned int GetScreenNumber() const
Returns the screen number the window is on.
Definition: syswin.cxx:962
Window(WindowType nType)
Definition: window.cxx:95
tools::Long mnWidth
Definition: salwtype.hxx:238
int i
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:418
bool IsSystemWindow() const
Definition: window2.cxx:991
int GetMaximizedY() const
Definition: windowstate.hxx:72
void SetMaxOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:376
tools::Long nY
Definition: salgeom.hxx:30
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
Definition: virdev.cxx:402
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1165
tools::Long mnMaximizedWidth
Definition: salwtype.hxx:242
virtual Size GetOptimalSize() const override
Definition: syswin.cxx:1010
constexpr tools::Long Right() const
int GetMaximizedX() const
Definition: windowstate.hxx:70
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
const AllSettings & GetSettings() const
Definition: window3.cxx:129
CommandEventId GetCommand() const
static void ImplHandleControlAccelerator(const vcl::Window *pWindow, bool bShow)
Definition: syswin.cxx:115
bool isCalculatingInitialLayoutSize() const
Definition: syswin.hxx:162
sal_uInt16 mnIcon
Definition: syswin.hxx:108
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:483
Size get_preferred_size() const
Definition: window2.cxx:1655
bool mbIsDeferredInit
Definition: syswin.hxx:113
constexpr tools::Long Top() const
std::unique_ptr< VclBuilder > m_pUIBuilder
Definition: syswin.hxx:86
void GrabFocusToDocument()
Definition: window.cxx:2986
void SetX(int nX)
Definition: windowstate.hxx:59
tools::ULong nTopDecoration
Definition: salgeom.hxx:34
bool isLayoutEnabled(const vcl::Window *pWindow)
Definition: layout.cxx:2904
MouseNotifyEvent GetType() const
Definition: event.hxx:308
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Definition: stacking.cxx:669
OUString maNotebookBarUIFile
Definition: syswin.hxx:111
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Definition: svapp.cxx:1226
Size maMinOutSize
Definition: syswin.hxx:101
void SetShowAccelerator(bool val)
Definition: ctrl.cxx:357
SAL_DLLPRIVATE void ImplMoveToScreen(tools::Long &io_rX, tools::Long &io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const *i_pConfigureWin)
Definition: syswin.cxx:557
bool IsTitleButtonVisible(TitleButton nButton) const
Definition: syswin.cxx:355
vcl::Window * GetParent() const
Definition: window2.cxx:1091
SAL_DLLPRIVATE bool hasPendingLayout() const
Definition: syswin.hxx:240
void SetWindowStateData(const WindowStateData &rData)
Definition: syswin.cxx:612
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2852
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:216
tools::Long mnHeight
Definition: salwtype.hxx:239
tools::Long nX
Definition: salgeom.hxx:30
void setOptimalLayoutSize()
Definition: syswin.cxx:1067
tools::ULong nWidth
Definition: salgeom.hxx:32
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1035
void disposeBuilder()
Definition: dialog.cxx:550
constexpr tools::Long Bottom() const
void SetMask(WindowStateMask nValidMask)
Definition: windowstate.hxx:56
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2666
void SetWidth(unsigned int nWidth)
Definition: windowstate.hxx:63
virtual ~SystemWindow() override
Definition: syswin.cxx:96
void GetWindowStateData(WindowStateData &rData) const
Definition: syswin.cxx:751
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
Definition: syswin.cxx:955
void SetMenuBarMode(MenuBarMode nMode)
Definition: syswin.cxx:940
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: syswin.cxx:101
bool IsShift() const
Definition: keycod.hxx:54
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: syswin.cxx:987
SAL_DLLPRIVATE void ImplToBottomChild()
Definition: stacking.cxx:194
void SetY(int nY)
Definition: windowstate.hxx:61
OUString maRepresentedURL
Definition: syswin.cxx:57
void SetMaximizedY(int nRY)
Definition: windowstate.hxx:71
void Stop()
Definition: scheduler.cxx:590
WindowType
Definition: ctrl.hxx:81
tools::Rectangle & Union(const tools::Rectangle &rRect)
#define SAL_WARN_IF(condition, area, stream)
MenuBar * GetMenuBar() const
Definition: syswin.hxx:182
constexpr tools::Long Height() const
ImplSVFrameData maFrameData
Definition: svdata.hxx:398
bool mbDockBtn
Definition: syswin.hxx:102
virtual OUString GetText() const override
Definition: syswin.cxx:1057
bool HandleKeyEvent(const KeyEvent &rKeyEvent)
tools::ULong nLeftDecoration
Definition: salgeom.hxx:34
::OutputDevice const * GetOutDev() const
Definition: window.cxx:568
virtual void SetText(const OUString &rStr) override
Definition: syswin.cxx:1051
tools::Long AdjustWidth(tools::Long n)
MenuBarMode mnMenuBarMode
Definition: syswin.hxx:107
bool IsMod1() const
Definition: keycod.hxx:56
virtual void settingOptimalLayoutSize(Window *pBox)
Definition: syswin.cxx:1063
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
tools::ULong nHeight
Definition: salgeom.hxx:32
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:411
tools::Long AdjustHeight(tools::Long n)
void SetWindowState(const OString &rStr)
Definition: syswin.cxx:830
Size GetOutputSizePixel() const
Definition: window3.cxx:89
WindowStateMask GetMask() const
Definition: windowstate.hxx:57
VclPtr< vcl::Window > mpDialogParent
Definition: syswin.hxx:114
void setHeight(tools::Long nHeight)
bool mbHideBtn
Definition: syswin.hxx:103
tools::Long mnMaximizedY
Definition: salwtype.hxx:241
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
void SetHeight(unsigned int nHeight)
Definition: windowstate.hxx:65
WindowType GetType() const
Definition: window2.cxx:968
virtual void PostPaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1133
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:243
tools::Long mnX
Definition: salwtype.hxx:236
#define SAL_WARN(area, stream)
tools::Long mnY
Definition: salwtype.hxx:237
void ImplWindowStateFromStr(WindowStateData &rData, const OString &rStr)
Definition: syswin.cxx:400
virtual void TitleButtonClick(TitleButton nButton)
Definition: syswin.cxx:285
WinBits GetStyle() const
Definition: window2.cxx:947
Definition: timer.hxx:26
TaskPaneList * GetTaskPaneList()
Definition: syswin.cxx:238
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:597
bool mbIsCalculatingInitialLayoutSize
Definition: syswin.hxx:105
WindowStateState
Definition: vclenum.hxx:301
WinBits const WB_CLOSEABLE
bool mbPaintComplete
Definition: syswin.hxx:106
void SetScreenNumber(unsigned int nNewScreen)
Move the Window to a new screen.
Definition: syswin.cxx:967
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:218
WindowStateMask mnMask
Definition: salwtype.hxx:244
SystemWindow(WindowType nType, const char *pIdleDebugName)
Definition: syswin.cxx:67
void RegisterMnemonic(const OUString &rKey)
Definition: mnemonic.cxx:81
sal_Int32 nState
void SetApplicationID(const OUString &rApplicationID)
Definition: syswin.cxx:972
bool mbSysChild
Definition: syswin.hxx:104
bool isDisposed() const
virtual void Resize() override
Definition: syswin.cxx:999
bool isLayoutEnabled() const
Definition: syswin.cxx:1004
void SetMenuBar(MenuBar *pMenuBar)
Definition: syswin.cxx:849
sal_Int32 get_border_width() const
Definition: window2.cxx:1836
SAL_DLLPRIVATE void DoInitialLayout()
Definition: syswin.cxx:1088
void GenerateAutoMnemonicsOnHierarchy(const vcl::Window *pWindow)
Definition: dialog.cxx:204
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1836
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
Definition: dialog.cxx:705
static bool IsQuit()
Has Quit() been called?
Definition: svapp.cxx:580
tools::ULong nBottomDecoration
Definition: salgeom.hxx:34
TitleButton
Definition: syswin.hxx:54
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
static SAL_DLLPRIVATE void ImplDestroy(MenuBar *pMenu, bool bDelete)
Definition: menu.cxx:2507
MenuBarMode
Definition: syswin.hxx:49