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