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#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 OString& 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::string_view rStr)
403{
404 vcl::WindowData& rData = *this;
406 sal_Int32 nIndex = 0;
407
408 std::string_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 OString();
528
529 OStringBuffer 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{
570 tools::Rectangle aScreenRect;
572 aScreenRect = Application::GetScreenPosSizePixel( GetScreenNumber() );
573 else
574 {
575 aScreenRect = Application::GetScreenPosSizePixel( 0 );
576 for( unsigned int i = 1; i < Application::GetScreenCount(); i++ )
578 }
579 // unfortunately most of the time width and height are not really known
580 if( i_nWidth < 1 )
581 i_nWidth = 50;
582 if( i_nHeight < 1 )
583 i_nHeight = 50;
584
585 // check left border
586 bool bMove = false;
587 if( io_rX + i_nWidth < aScreenRect.Left() )
588 {
589 bMove = true;
590 io_rX = aScreenRect.Left();
591 }
592 // check right border
593 if( io_rX > aScreenRect.Right() - i_nWidth )
594 {
595 bMove = true;
596 io_rX = aScreenRect.Right() - i_nWidth;
597 }
598 // check top border
599 if( io_rY + i_nHeight < aScreenRect.Top() )
600 {
601 bMove = true;
602 io_rY = aScreenRect.Top();
603 }
604 // check bottom border
605 if( io_rY > aScreenRect.Bottom() - i_nHeight )
606 {
607 bMove = true;
608 io_rY = aScreenRect.Bottom() - i_nHeight;
609 }
610 vcl::Window* pParent = i_pConfigureWin->GetParent();
611 if( bMove && pParent )
612 {
613 // calculate absolute screen pos here, since that is what is contained in WindowData
614 Point aParentAbsPos( pParent->OutputToAbsoluteScreenPixel( Point(0,0) ) );
615 Size aParentSizePixel( pParent->GetOutputSizePixel() );
616 Point aPos( (aParentSizePixel.Width() - i_nWidth) / 2,
617 (aParentSizePixel.Height() - i_nHeight) / 2 );
618 io_rX = aParentAbsPos.X() + aPos.X();
619 io_rY = aParentAbsPos.Y() + aPos.Y();
620 }
621}
622
624{
625 const vcl::WindowDataMask nValidMask = rData.mask();
626 if ( nValidMask == vcl::WindowDataMask::NONE )
627 return;
628
629 if ( mbSysChild )
630 return;
631
632 vcl::Window* pWindow = this;
633 while ( pWindow->mpWindowImpl->mpBorderWindow )
634 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
635
636 if ( pWindow->mpWindowImpl->mbFrame )
637 {
638 const vcl::WindowState nState = rData.state();
639 vcl::WindowData aState = rData;
640
641 if (rData.mask() & vcl::WindowDataMask::Size)
642 {
643 // #i43799# adjust window state sizes if a minimal output size was set
644 // otherwise the frame and the client might get different sizes
645 if (maMinOutSize.Width() > static_cast<tools::Long>(aState.width()))
646 aState.setWidth(maMinOutSize.Width());
647 if (maMinOutSize.Height() > static_cast<tools::Long>(aState.width()))
648 aState.setHeight(maMinOutSize.Height());
649 }
650
651 // #94144# allow Minimize again, should be masked out when read from configuration
652 // 91625 - ignore Minimize
653 //nState &= ~(WindowState::Minimized);
655
656 // normalize window positions onto screen
657 tools::Long nX = aState.x(), nY = aState.y();
658 ImplMoveToScreen(nX, nY, aState.width(), aState.height(), pWindow);
659 aState.setPos({ nX, nY });
660 nX = aState.GetMaximizedX();
661 nY = aState.GetMaximizedY();
662 ImplMoveToScreen(nX, nY, aState.GetMaximizedWidth(), aState.GetMaximizedHeight(), pWindow);
663 aState.SetMaximizedX(nX);
664 aState.SetMaximizedY(nY);
665
666 // #96568# avoid having multiple frames at the same screen location
667 // do the check only if not maximized
670 {
671 tools::Rectangle aDesktop = GetDesktopRectPixel();
672 ImplSVData *pSVData = ImplGetSVData();
673 vcl::Window *pWin = pSVData->maFrameData.mpFirstFrame;
674 bool bWrapped = false;
675 while( pWin )
676 {
677 if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
678 pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible )
679 {
680 SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry();
681 if( std::abs(g.x()-aState.x()) < 2 && std::abs(g.y()-aState.y()) < 5 )
682 {
683 tools::Long displacement = g.topDecoration() ? g.topDecoration() : 20;
684 if( static_cast<tools::Long>(aState.x() + displacement + aState.width() + g.rightDecoration()) > aDesktop.Right() ||
685 static_cast<tools::Long>(aState.y() + displacement + aState.height() + g.bottomDecoration()) > aDesktop.Bottom() )
686 {
687 // displacing would leave screen
688 aState.setX(g.leftDecoration() ? g.leftDecoration() : 10); // should result in (0,0)
689 aState.setY(displacement);
690 if( bWrapped ||
691 static_cast<tools::Long>(aState.x() + displacement + aState.width() + g.rightDecoration()) > aDesktop.Right() ||
692 static_cast<tools::Long>(aState.y() + displacement + aState.height() + g.bottomDecoration()) > aDesktop.Bottom() )
693 break; // further displacement not possible -> break
694 // avoid endless testing
695 bWrapped = true;
696 }
697 else
698 aState.move(displacement, displacement);
699 pWin = pSVData->maFrameData.mpFirstFrame; // check new pos again
700 }
701 }
702 pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
703 }
704 }
705
706 mpWindowImpl->mpFrame->SetWindowState( &aState );
707
708 // do a synchronous resize for layout reasons
709 // but use rData only when the window is not to be maximized (#i38089#)
710 // otherwise we have no useful size information
712 {
713 // query maximized size from frame
714 SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
715
716 // but use it only if it is different from the restore size (rData)
717 // as currently only on windows the exact size of a maximized window
718 // can be computed without actually showing the window
719 if (aGeometry.width() != rData.width() || aGeometry.height() != rData.height())
720 ImplHandleResize(pWindow, aGeometry.width(), aGeometry.height());
721 }
722 else
723 if (rData.mask() & vcl::WindowDataMask::Size)
724 ImplHandleResize(pWindow, aState.width(), aState.height()); // #i43799# use aState and not rData, see above
725 }
726 else
727 {
729 if ( nValidMask & vcl::WindowDataMask::X )
730 nPosSize |= PosSizeFlags::X;
731 if ( nValidMask & vcl::WindowDataMask::Y )
732 nPosSize |= PosSizeFlags::Y;
733 if ( nValidMask & vcl::WindowDataMask::Width )
734 nPosSize |= PosSizeFlags::Width;
735 if ( nValidMask & vcl::WindowDataMask::Height )
736 nPosSize |= PosSizeFlags::Height;
737
738 tools::Long nX = rData.x();
739 tools::Long nY = rData.y();
740 tools::Long nWidth = rData.width();
741 tools::Long nHeight = rData.height();
742 const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
743 if( nX < 0 )
744 nX = 0;
745 if( nX + nWidth > static_cast<tools::Long>(rGeom.width()) )
746 nX = rGeom.width() - nWidth;
747 if( nY < 0 )
748 nY = 0;
749 if( nY + nHeight > static_cast<tools::Long>(rGeom.height()) )
750 nY = rGeom.height() - nHeight;
751 setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
752 }
753
754 // tdf#146648 if an explicit size state was set, then use it as the preferred
755 // size for layout
756 if (nValidMask & vcl::WindowDataMask::Size)
757 mbInitialLayoutSizeCalculated = true;
758}
759
761{
762 vcl::WindowDataMask nValidMask = rData.mask();
763 if ( nValidMask == vcl::WindowDataMask::NONE )
764 return;
765
766 if ( mbSysChild )
767 {
769 return;
770 }
771
772 const vcl::Window* pWindow = this;
773 while ( pWindow->mpWindowImpl->mpBorderWindow )
774 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
775
776 if ( pWindow->mpWindowImpl->mbFrame )
777 {
778 vcl::WindowData aState;
779 if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
780 {
781 // Limit mask only to what we've received, the rest is not set.
782 nValidMask &= aState.mask();
783 rData.setMask( nValidMask );
784 if ( nValidMask & vcl::WindowDataMask::X )
785 rData.setX( aState.x() );
786 if ( nValidMask & vcl::WindowDataMask::Y )
787 rData.setY( aState.y() );
788 if ( nValidMask & vcl::WindowDataMask::Width )
789 rData.setWidth( aState.width() );
790 if ( nValidMask & vcl::WindowDataMask::Height )
791 rData.setHeight( aState.height() );
792 if ( nValidMask & vcl::WindowDataMask::MaximizedX )
793 rData.SetMaximizedX( aState.GetMaximizedX() );
794 if ( nValidMask & vcl::WindowDataMask::MaximizedY )
795 rData.SetMaximizedY( aState.GetMaximizedY() );
796 if ( nValidMask & vcl::WindowDataMask::MaximizedWidth )
797 rData.SetMaximizedWidth( aState.GetMaximizedWidth() );
798 if ( nValidMask & vcl::WindowDataMask::MaximizedHeight )
799 rData.SetMaximizedHeight( aState.GetMaximizedHeight() );
800 if ( nValidMask & vcl::WindowDataMask::State )
801 {
802 // #94144# allow Minimize again, should be masked out when read from configuration
803 // 91625 - ignore Minimize
804 if (!(nValidMask & vcl::WindowDataMask::Minimized))
805 aState.rState() &= ~vcl::WindowState::Minimized;
806 rData.setState(aState.state());
807 }
808 rData.setMask( nValidMask );
809 }
810 else
812 }
813 else
814 {
815 Point aPos = GetPosPixel();
816 Size aSize = GetSizePixel();
818
820 rData.setMask( nValidMask );
821 if (nValidMask & vcl::WindowDataMask::X)
822 rData.setX(aPos.X());
823 if (nValidMask & vcl::WindowDataMask::Y)
824 rData.setY(aPos.Y());
825 if (nValidMask & vcl::WindowDataMask::Width)
826 rData.setWidth(aSize.Width());
827 if (nValidMask & vcl::WindowDataMask::Height)
828 rData.setHeight(aSize.Height());
829 if (nValidMask & vcl::WindowDataMask::State)
830 rData.setState(nState);
831 }
832}
833
834void SystemWindow::SetWindowState(std::string_view rStr)
835{
836 if (rStr.empty())
837 return;
838 SetWindowState(vcl::WindowData(rStr));
839}
840
842{
844 aData.setMask(nMask);
845 GetWindowState(aData);
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 );
881 ImplToBottomChild();
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
914void 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())
925 GetNotebookBar()->SetSystemWindow(this);
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
963{
964 return mpWindowImpl->mpFrame->maGeometry.screen();
965}
966
967void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen)
968{
969 mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
970}
971
972void 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;
991 if (isCalculatingInitialLayoutSize())
992 return;
993 InvalidateSizeCache();
994 if (hasPendingLayout())
995 return;
996 maLayoutIdle.Start();
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
1015 Window *pBox = GetWindow(GetWindowType::FirstChild);
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
1036 VclContainer::setLayoutAllocation(rBox, aPos, CalcOutputSize(aSize));
1037}
1038
1039IMPL_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
1051void SystemWindow::SetText(const OUString& rStr)
1052{
1053 setDeferredProperties();
1054 Window::SetText(rStr);
1055}
1056
1058{
1059 const_cast<SystemWindow*>(this)->setDeferredProperties();
1060 return Window::GetText();
1061}
1062
1064{
1065}
1066
1067void SystemWindow::setOptimalLayoutSize(bool bAllowWindowShrink)
1068{
1069 maLayoutIdle.Stop();
1070
1071 //resize SystemWindow to fit requisition on initial show
1072 Window *pBox = GetWindow(GetWindowType::FirstChild);
1073
1074 settingOptimalLayoutSize(pBox);
1075
1076 Size aSize = get_preferred_size();
1077
1078 Size aMax(bestmaxFrameSizeForScreenSize(GetDesktopRectPixel().GetSize()));
1079
1080 aSize.setWidth( std::min(aMax.Width(), aSize.Width()) );
1081 aSize.setHeight( std::min(aMax.Height(), aSize.Height()) );
1082
1083 SetMinOutputSizePixel(aSize);
1084
1085 if (!bAllowWindowShrink)
1086 {
1087 Size aCurrentSize = GetSizePixel();
1088 aSize.setWidth(std::max(aSize.Width(), aCurrentSize.Width()));
1089 aSize.setHeight(std::max(aSize.Height(), aCurrentSize.Height()));
1090 }
1091
1092 SetSizePixel(aSize);
1093 setPosSizeOnContainee(aSize, *pBox);
1094}
1095
1097{
1098 if (GetSettings().GetStyleSettings().GetAutoMnemonic())
1100
1101 if (isLayoutEnabled())
1102 {
1103 mbIsCalculatingInitialLayoutSize = true;
1104 setDeferredProperties();
1105 setOptimalLayoutSize(!mbInitialLayoutSizeCalculated);
1106 mbInitialLayoutSizeCalculated = true;
1107 mbIsCalculatingInitialLayoutSize = false;
1108 }
1109}
1110
1112{
1113 SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
1114}
1115
1117{
1118 // same prerequisites as in Execute()
1119 setDeferredProperties();
1120 ImplAdjustNWFSizes();
1121 Show();
1122 ToTop();
1123 ensureRepaint();
1124
1125 Size aSize(GetOutputSizePixel());
1126
1128 xOutput->SetOutputSizePixel(aSize);
1129
1130 Point aPos;
1131 xOutput->DrawOutDev(aPos, aSize, aPos, aSize, *GetOutDev());
1132
1133 return xOutput;
1134}
1135
1137{
1138 Window::PrePaint(rRenderContext);
1139 mbPaintComplete = false;
1140}
1141
1143{
1144 Window::PostPaint(rRenderContext);
1145 mbPaintComplete = true;
1146}
1147
1149{
1150 // ensure repaint
1151 Invalidate();
1152 mbPaintComplete = false;
1153
1154 while (!mbPaintComplete && !Application::IsQuit())
1155 {
1157 }
1158}
1159
1161{
1162 if (MenuBar* pMenu = GetMenuBar())
1163 {
1164 sal_uInt16 nMenuItems = pMenu->GetItemCount();
1165 for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
1166 rMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
1167 }
1168}
1169
1171{
1172 if (MenuBar* pMenuBar = GetMenuBar())
1173 return pMenuBar->GetMenuBarHeight();
1174 return 0;
1175}
1176
1177/* 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:557
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Definition: svapp.cxx:1348
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area.
Definition: svapp.cxx:1354
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
Definition: svapp.cxx:1389
static bool IsQuit()
Has Quit() been called?
Definition: svapp.cxx:614
CommandEventId GetCommand() const
const CommandModKeyData * GetModKeyData() const
bool IsDown() const
bool IsMod2() const
Definition: ctrl.hxx:82
void SetShowAccelerator(bool val)
Definition: ctrl.cxx:366
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent &rKEvent)
Definition: menu.cxx:2484
static SAL_DLLPRIVATE VclPtr< vcl::Window > ImplCreate(vcl::Window *pParent, vcl::Window *pWindow, MenuBar *pMenu)
Definition: menu.cxx:2449
static SAL_DLLPRIVATE void ImplDestroy(MenuBar *pMenu, bool bDelete)
Definition: menu.cxx:2468
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:128
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:210
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 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:1057
bool mbInitialLayoutSizeCalculated
Definition: syswin.hxx:106
bool mbPaintComplete
Definition: syswin.hxx:107
const Link< SystemWindow &, void > & GetCloseHdl() const
Definition: syswin.cxx:982
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: syswin.cxx:987
void CloseNotebookBar()
Definition: syswin.cxx:929
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:955
void CollectMenuBarMnemonics(MnemonicGenerator &rMnemonicGenerator) const
Definition: syswin.cxx:1160
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:1051
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:1142
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem, bool bReloadNotebookbar=false)
Definition: syswin.cxx:914
VclPtr< VirtualDevice > createScreenshot()
Definition: syswin.cxx:1116
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox)
Definition: syswin.cxx:1028
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:198
OString GetWindowState(vcl::WindowDataMask nMask=vcl::WindowDataMask::All) const
Definition: syswin.cxx:841
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:1096
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:1148
virtual void TitleButtonClick(TitleButton nButton)
Definition: syswin.cxx:287
virtual Size GetOptimalSize() const override
Definition: syswin.cxx:1010
bool isLayoutEnabled() const
Definition: syswin.cxx:1004
std::unique_ptr< ImplData > mpImplData
Definition: syswin.hxx:110
virtual void settingOptimalLayoutSize(Window *pBox)
Definition: syswin.cxx:1063
const Size & GetMaxOutputSizePixel() const
Definition: syswin.cxx:397
void SetCloseHdl(const Link< SystemWindow &, void > &rLink)
Definition: syswin.cxx:977
TaskPaneList * GetTaskPaneList()
Definition: syswin.cxx:240
virtual void doDeferredInit(WinBits nBits)
Definition: syswin.cxx:1111
bool mbDockBtn
Definition: syswin.hxx:102
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:90
void SetWindowState(const vcl::WindowData &rData)
Definition: syswin.cxx:623
void SetMaxOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:378
virtual bool Close()
Definition: syswin.cxx:262
void SetApplicationID(const OUString &rApplicationID)
Definition: syswin.cxx:972
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:1067
void SetMenuBarMode(MenuBarMode nMode)
Definition: syswin.cxx:940
VclPtr< NotebookBar > const & GetNotebookBar() const
Definition: syswin.cxx:935
VclPtr< vcl::Window > mpDialogParent
Definition: syswin.hxx:115
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1136
void SetScreenNumber(unsigned int nNewScreen)
Move the Window to a new screen.
Definition: syswin.cxx:967
unsigned int GetScreenNumber() const
Returns the screen number the window is on.
Definition: syswin.cxx:962
void SetMenuBar(MenuBar *pMenuBar)
Definition: syswin.cxx:849
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:999
MenuBarMode mnMenuBarMode
Definition: syswin.hxx:108
int GetMenuBarHeight() const
Definition: syswin.cxx:1170
Idle maLayoutIdle
Definition: syswin.hxx:111
TabPage * GetTabPage(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1921
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1865
bool HandleKeyEvent(const KeyEvent &rKeyEvent)
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:607
void Stop()
Definition: scheduler.cxx:600
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)
Definition: virdev.cxx:403
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
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)
OString toStr() const
Definition: syswin.cxx:523
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:1136
WindowType GetType() const
Definition: window2.cxx:1013
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:909
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1276
void GrabFocusToDocument()
Definition: window.cxx:2993
WinBits GetStyle() const
Definition: window2.cxx:992
Size CalcWindowSize(const Size &rOutSz) const
Definition: window2.cxx:569
Window(WindowType nType)
Definition: window.cxx:95
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
void Hide()
Definition: window.hxx:885
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:484
bool IsSystemWindow() const
Definition: window2.cxx:1036
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsTopWindow() const
Definition: stacking.cxx:608
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2859
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:219
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3033
virtual OUString GetText() const
Definition: window.cxx:3062
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:869
virtual void PostPaint(vcl::RenderContext &rRenderContext)
Definition: paint.cxx:1016
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:940
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Definition: stacking.cxx:669
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:2951
#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:408
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:250
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
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