LibreOffice Module vcl (master) 1
window2.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 <limits.h>
21
23#include <sal/log.hxx>
24
25#include <tools/helpers.hxx>
26
28#include <vcl/event.hxx>
29#include <vcl/toolkit/fixed.hxx>
30#include <vcl/layout.hxx>
31#include <vcl/timer.hxx>
32#include <vcl/window.hxx>
33#include <vcl/scrollable.hxx>
35#include <vcl/dockwin.hxx>
36#include <vcl/settings.hxx>
37#include <vcl/builder.hxx>
38#include <o3tl/string_view.hxx>
39
40#include <window.h>
41#include <svdata.hxx>
42#include <salgdi.hxx>
43#include <salframe.hxx>
44#include <scrwnd.hxx>
45
46#include <com/sun/star/accessibility/AccessibleRelation.hpp>
47#include <com/sun/star/accessibility/AccessibleRole.hpp>
48
49using namespace com::sun::star;
50
51namespace vcl {
52
54{
55 if( mpWindowImpl->mbInShowFocus )
56 return;
57 mpWindowImpl->mbInShowFocus = true;
58
59 ImplWinData* pWinData = ImplGetWinData();
60
61 // native themeing suggest not to use focus rects
62 if( ! ( mpWindowImpl->mbUseNativeFocus &&
64 {
65 if ( !mpWindowImpl->mbInPaint )
66 {
67 if ( mpWindowImpl->mbFocusVisible )
68 {
69 if ( *pWinData->mpFocusRect == rRect )
70 {
71 mpWindowImpl->mbInShowFocus = false;
72 return;
73 }
74
75 ImplInvertFocus( *pWinData->mpFocusRect );
76 }
77
78 ImplInvertFocus( rRect );
79 }
80 pWinData->mpFocusRect = rRect;
81 mpWindowImpl->mbFocusVisible = true;
82 }
83 else
84 {
85 if( ! mpWindowImpl->mbNativeFocusVisible )
86 {
87 mpWindowImpl->mbNativeFocusVisible = true;
88 if ( !mpWindowImpl->mbInPaint )
89 Invalidate();
90 }
91 }
92 mpWindowImpl->mbInShowFocus = false;
93}
94
96{
97
98 if( mpWindowImpl->mbInHideFocus )
99 return;
100 mpWindowImpl->mbInHideFocus = true;
101
102 // native themeing can suggest not to use focus rects
103 if( ! ( mpWindowImpl->mbUseNativeFocus &&
105 {
106 if ( !mpWindowImpl->mbFocusVisible )
107 {
108 mpWindowImpl->mbInHideFocus = false;
109 return;
110 }
111
112 if ( !mpWindowImpl->mbInPaint )
113 ImplInvertFocus( *ImplGetWinData()->mpFocusRect );
114 mpWindowImpl->mbFocusVisible = false;
115 }
116 else
117 {
118 if( mpWindowImpl->mbNativeFocusVisible )
119 {
120 mpWindowImpl->mbNativeFocusVisible = false;
121 if ( !mpWindowImpl->mbInPaint )
122 Invalidate();
123 }
124 }
125 mpWindowImpl->mbInHideFocus = false;
126}
127
129{
130 ImplWinData* pWinData = ImplGetWinData();
131
132 if ( !mpWindowImpl->mbInPaint || !(nFlags & ShowTrackFlags::TrackWindow) )
133 {
134 if ( mpWindowImpl->mbTrackVisible )
135 {
136 if ( (*pWinData->mpTrackRect == rRect) &&
137 (pWinData->mnTrackFlags == nFlags) )
138 return;
139
140 InvertTracking( *pWinData->mpTrackRect, pWinData->mnTrackFlags );
141 }
142
143 InvertTracking( rRect, nFlags );
144 }
145
146 pWinData->mpTrackRect = rRect;
147 pWinData->mnTrackFlags = nFlags;
148 mpWindowImpl->mbTrackVisible = true;
149}
150
152{
153 if ( mpWindowImpl->mbTrackVisible )
154 {
155 ImplWinData* pWinData = ImplGetWinData();
156 if ( !mpWindowImpl->mbInPaint || !(pWinData->mnTrackFlags & ShowTrackFlags::TrackWindow) )
157 InvertTracking( *pWinData->mpTrackRect, pWinData->mnTrackFlags );
158 mpWindowImpl->mbTrackVisible = false;
159 }
160}
161
163{
164 OutputDevice *pOutDev = GetOutDev();
165 tools::Rectangle aRect( pOutDev->ImplLogicToDevicePixel( rRect ) );
166
167 if ( aRect.IsEmpty() )
168 return;
169 aRect.Normalize();
170
171 SalGraphics* pGraphics;
172
173 if ( nFlags & ShowTrackFlags::TrackWindow )
174 {
175 if ( !GetOutDev()->IsDeviceOutputNecessary() )
176 return;
177
178 // we need a graphics
179 if ( !GetOutDev()->mpGraphics )
180 {
181 if ( !pOutDev->AcquireGraphics() )
182 return;
183 }
184
185 if ( GetOutDev()->mbInitClipRegion )
187
188 if ( GetOutDev()->mbOutputClipped )
189 return;
190
191 pGraphics = GetOutDev()->mpGraphics;
192 }
193 else
194 {
195 pGraphics = ImplGetFrameGraphics();
196
197 if ( nFlags & ShowTrackFlags::Clip )
198 {
199 vcl::Region aRegion( GetOutputRectPixel() );
200 ImplClipBoundaries( aRegion, false, false );
201 pOutDev->SelectClipRegion( aRegion, pGraphics );
202 }
203 }
204
206 if ( nStyle == ShowTrackFlags::Object )
207 pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::TrackFrame, *GetOutDev() );
208 else if ( nStyle == ShowTrackFlags::Split )
209 pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::N50, *GetOutDev() );
210 else
211 {
213 if ( nStyle == ShowTrackFlags::Big )
214 nBorder = 5;
215 pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), nBorder, SalInvert::N50, *GetOutDev() );
216 pGraphics->Invert( aRect.Left(), aRect.Bottom()-nBorder+1, aRect.GetWidth(), nBorder, SalInvert::N50, *GetOutDev() );
217 pGraphics->Invert( aRect.Left(), aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, *GetOutDev() );
218 pGraphics->Invert( aRect.Right()-nBorder+1, aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, *GetOutDev() );
219 }
220}
221
222IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void )
223{
224 ImplSVData* pSVData = ImplGetSVData();
225
226 // if Button-Repeat we have to change the timeout
228 pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
229
230 // create Tracking-Event
231 Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY );
232 if( GetOutDev()->ImplIsAntiparallel() )
233 {
234 // re-mirror frame pos at pChild
235 const OutputDevice *pOutDev = GetOutDev();
236 pOutDev->ReMirror( aMousePos );
237 }
238 MouseEvent aMEvt( ImplFrameToOutput( aMousePos ),
239 mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE,
240 mpWindowImpl->mpFrameData->mnMouseCode,
241 mpWindowImpl->mpFrameData->mnMouseCode );
243 Tracking( aTEvt );
244}
245
246void Window::SetUseFrameData(bool bUseFrameData)
247{
248 if (mpWindowImpl)
249 mpWindowImpl->mbUseFrameData = bUseFrameData;
250}
251
253{
254 if (!mpWindowImpl)
255 return;
256
257 ImplSVData* pSVData = ImplGetSVData();
258 VclPtr<vcl::Window> pTrackWin = mpWindowImpl->mbUseFrameData ?
259 mpWindowImpl->mpFrameData->mpTrackWin :
260 pSVData->mpWinData->mpTrackWin;
261
262 if ( pTrackWin.get() != this )
263 {
264 if ( pTrackWin )
266 }
267
268 if ( !mpWindowImpl->mbUseFrameData &&
270 {
271 pSVData->mpWinData->mpTrackTimer = new AutoTimer("vcl::Window pSVData->mpWinData->mpTrackTimer");
272
275 else
277 pSVData->mpWinData->mpTrackTimer->SetInvokeHandler( LINK( this, Window, ImplTrackTimerHdl ) );
278 pSVData->mpWinData->mpTrackTimer->Start();
279 }
280
281 if (mpWindowImpl->mbUseFrameData)
282 {
283 mpWindowImpl->mpFrameData->mpTrackWin = this;
284 }
285 else
286 {
287 pSVData->mpWinData->mpTrackWin = this;
288 pSVData->mpWinData->mnTrackFlags = nFlags;
289 CaptureMouse();
290 }
291}
292
294{
295 if (!mpWindowImpl)
296 return;
297
298 ImplSVData* pSVData = ImplGetSVData();
299 VclPtr<vcl::Window> pTrackWin = mpWindowImpl->mbUseFrameData ?
300 mpWindowImpl->mpFrameData->mpTrackWin :
301 pSVData->mpWinData->mpTrackWin;
302
303 if ( pTrackWin.get() != this )
304 return;
305
306 if ( !mpWindowImpl->mbUseFrameData && pSVData->mpWinData->mpTrackTimer )
307 {
308 delete pSVData->mpWinData->mpTrackTimer;
309 pSVData->mpWinData->mpTrackTimer = nullptr;
310 }
311
312 mpWindowImpl->mpFrameData->mpTrackWin = pSVData->mpWinData->mpTrackWin = nullptr;
314 ReleaseMouse();
315
316 // call EndTracking if required
317 if (mpWindowImpl->mpFrameData)
318 {
319 Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY );
320 if( GetOutDev()->ImplIsAntiparallel() )
321 {
322 // re-mirror frame pos at pChild
323 const OutputDevice *pOutDev = GetOutDev();
324 pOutDev->ReMirror( aMousePos );
325 }
326
327 MouseEvent aMEvt( ImplFrameToOutput( aMousePos ),
328 mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE,
329 mpWindowImpl->mpFrameData->mnMouseCode,
330 mpWindowImpl->mpFrameData->mnMouseCode );
331 TrackingEvent aTEvt( aMEvt, nFlags | TrackingEventFlags::End );
332 // CompatTracking effectively
333 if (!mpWindowImpl || mpWindowImpl->mbInDispose)
334 return Window::Tracking( aTEvt );
335 else
336 return Tracking( aTEvt );
337 }
338}
339
341{
342 return (mpWindowImpl->mbUseFrameData ?
343 mpWindowImpl->mpFrameData->mpTrackWin == this :
344 ImplGetSVData()->mpWinData->mpTrackWin == this);
345}
346
348{
349 ImplSVData* pSVData = ImplGetSVData();
350
351 if ( pSVData->mpWinData->mpAutoScrollWin.get() != this )
352 {
353 if ( pSVData->mpWinData->mpAutoScrollWin )
355 }
356
357 pSVData->mpWinData->mpAutoScrollWin = this;
358 pSVData->mpWinData->mnAutoScrollFlags = nFlags;
360}
361
363{
364 ImplSVData* pSVData = ImplGetSVData();
365
366 if ( pSVData->mpWinData->mpAutoScrollWin.get() == this )
367 {
368 pSVData->mpWinData->mpAutoScrollWin = nullptr;
370 pSVData->maAppData.mpWheelWindow->ImplStop();
372 }
373}
374
376{
377 ImplSVData* pSVData = ImplGetSVData();
378 if ( pSVData->mpWinData->mpFocusWin )
379 {
380 return pSVData->mpWinData->mpFocusWin;
381 }
382 else
383 return nullptr;
384}
385
387{
388 if (xFocusWin && !xFocusWin->isDisposed())
389 {
390 xFocusWin->GrabFocus();
391 }
392}
393
394void Window::SetZoom( const Fraction& rZoom )
395{
396 if ( mpWindowImpl && mpWindowImpl->maZoom != rZoom )
397 {
398 mpWindowImpl->maZoom = rZoom;
400 }
401}
402
403void Window::SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont)
404{
405 const Fraction& rZoom = GetZoom();
406 if (rZoom.GetNumerator() != rZoom.GetDenominator())
407 {
408 vcl::Font aFont(rFont);
409 Size aSize = aFont.GetFontSize();
410 aSize.setWidth( FRound(double(aSize.Width() * rZoom)) );
411 aSize.setHeight( FRound(double(aSize.Height() * rZoom)) );
412 aFont.SetFontSize(aSize);
413 SetPointFont(rRenderContext, aFont);
414 }
415 else
416 {
417 SetPointFont(rRenderContext, rFont);
418 }
419}
420
422{
423
424 const Fraction& rZoom = GetZoom();
425 if ( rZoom.GetNumerator() != rZoom.GetDenominator() )
426 {
427 double n = double(nCalc * rZoom);
428 nCalc = FRound( n );
429 }
430 return nCalc;
431}
432
434{
435 if (mpWindowImpl && mpWindowImpl->mpControlFont)
436 {
437 mpWindowImpl->mpControlFont.reset();
439 }
440}
441
443{
444 if (rFont == vcl::Font())
445 {
447 return;
448 }
449
450 if (mpWindowImpl->mpControlFont)
451 {
452 if (*mpWindowImpl->mpControlFont == rFont)
453 return;
454 *mpWindowImpl->mpControlFont = rFont;
455 }
456 else
457 mpWindowImpl->mpControlFont = rFont;
458
460}
461
463{
464 if (mpWindowImpl->mpControlFont)
465 return *mpWindowImpl->mpControlFont;
466 else
467 {
468 vcl::Font aFont;
469 return aFont;
470 }
471}
472
473void Window::ApplyControlFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont)
474{
475 vcl::Font aFont(rFont);
476 if (IsControlFont())
477 aFont.Merge(GetControlFont());
478 SetZoomedPointFont(rRenderContext, aFont);
479}
480
482{
483 if (mpWindowImpl->mbControlForeground)
484 {
485 mpWindowImpl->maControlForeground = COL_TRANSPARENT;
486 mpWindowImpl->mbControlForeground = false;
488 }
489}
490
492{
493 if (rColor.IsTransparent())
494 {
495 if (mpWindowImpl->mbControlForeground)
496 {
497 mpWindowImpl->maControlForeground = COL_TRANSPARENT;
498 mpWindowImpl->mbControlForeground = false;
500 }
501 }
502 else
503 {
504 if (mpWindowImpl->maControlForeground != rColor)
505 {
506 mpWindowImpl->maControlForeground = rColor;
507 mpWindowImpl->mbControlForeground = true;
509 }
510 }
511}
512
513void Window::ApplyControlForeground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor)
514{
515 Color aTextColor(rDefaultColor);
517 aTextColor = GetControlForeground();
518 rRenderContext.SetTextColor(aTextColor);
519}
520
522{
523 if (mpWindowImpl->mbControlBackground)
524 {
525 mpWindowImpl->maControlBackground = COL_TRANSPARENT;
526 mpWindowImpl->mbControlBackground = false;
528 }
529}
530
532{
533 if (rColor.IsTransparent())
534 {
535 if (mpWindowImpl->mbControlBackground)
536 {
537 mpWindowImpl->maControlBackground = COL_TRANSPARENT;
538 mpWindowImpl->mbControlBackground = false;
540 }
541 }
542 else
543 {
544 if (mpWindowImpl->maControlBackground != rColor)
545 {
546 mpWindowImpl->maControlBackground = rColor;
547 mpWindowImpl->mbControlBackground = true;
549 }
550 }
551}
552
553void Window::ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor)
554{
555 Color aColor(rDefaultColor);
557 aColor = GetControlBackground();
558 rRenderContext.SetBackground(aColor);
559}
560
561Size Window::CalcWindowSize( const Size& rOutSz ) const
562{
563 Size aSz = rOutSz;
564 aSz.AdjustWidth(mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder );
565 aSz.AdjustHeight(mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder );
566 return aSz;
567}
568
569Size Window::CalcOutputSize( const Size& rWinSz ) const
570{
571 Size aSz = rWinSz;
572 aSz.AdjustWidth( -(mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder) );
573 aSz.AdjustHeight( -(mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder) );
574 return aSz;
575}
576
578{
579 vcl::Font aFont = GetPointFont(*GetOutDev());
580 Size aFontSize = aFont.GetFontSize();
581 MapMode aPtMapMode(MapUnit::MapPoint);
582 aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );
583 aFont.SetFontSize( aFontSize );
584 return aFont;
585}
586
588{
589 tools::Long nP = nPixels;
590 if ( pDev->GetOutDevType() != OUTDEV_WINDOW )
591 {
592 MapMode aMap( MapUnit::Map100thMM );
593 Size aSz( nP, 0 );
594 aSz = PixelToLogic( aSz, aMap );
595 aSz = pDev->LogicToPixel( aSz, aMap );
596 nP = aSz.Width();
597 }
598 return nP;
599}
600
601static void lcl_HandleScrollHelper( Scrollable* pScrl, double nN, bool isMultiplyByLineSize )
602{
603 if (!pScrl || !nN || pScrl->Inactive())
604 return;
605
606 tools::Long nNewPos = pScrl->GetThumbPos();
607
608 if ( nN == double(-LONG_MAX) )
609 nNewPos += pScrl->GetPageSize();
610 else if ( nN == double(LONG_MAX) )
611 nNewPos -= pScrl->GetPageSize();
612 else
613 {
614 // allowing both chunked and continuous scrolling
615 if(isMultiplyByLineSize){
616 nN*=pScrl->GetLineSize();
617 }
618
619 const double fVal = nNewPos - nN;
620
621 nNewPos = o3tl::saturating_cast<tools::Long>(fVal);
622 }
623
624 pScrl->DoScroll( nNewPos );
625
626}
627
629 Scrollable* pHScrl, Scrollable* pVScrl )
630{
631 bool bRet = false;
632
633 if ( pHScrl || pVScrl )
634 {
635 switch( rCmd.GetCommand() )
636 {
638 {
640 if ( pHScrl )
641 {
642 if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
643 !pHScrl->Inactive() )
645 }
646 if ( pVScrl )
647 {
648 if ( (pVScrl->GetVisibleSize() < pVScrl->GetRangeMax()) &&
649 !pVScrl->Inactive() )
651 }
652
653 if ( nFlags != StartAutoScrollFlags::NONE )
654 {
655 StartAutoScroll( nFlags );
656 bRet = true;
657 }
658 }
659 break;
660
662 {
663 const CommandWheelData* pData = rCmd.GetWheelData();
664
665 if ( pData && (CommandWheelMode::SCROLL == pData->GetMode()) )
666 {
667 if (!pData->IsDeltaPixel())
668 {
669 double nScrollLines = pData->GetScrollLines();
670 double nLines;
671 if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
672 {
673 if ( pData->GetDelta() < 0 )
674 nLines = double(-LONG_MAX);
675 else
676 nLines = double(LONG_MAX);
677 }
678 else
679 nLines = pData->GetNotchDelta() * nScrollLines;
680 if ( nLines )
681 {
682 ImplHandleScroll( nullptr,
683 0L,
684 pData->IsHorz() ? pHScrl : pVScrl,
685 nLines );
686 bRet = true;
687 }
688 }
689 else
690 {
691 // Mobile / touch scrolling section
692 const Point & deltaPoint = rCmd.GetMousePosPixel();
693
694 double deltaXInPixels = double(deltaPoint.X());
695 double deltaYInPixels = double(deltaPoint.Y());
696 Size winSize = GetOutputSizePixel();
697
698 if(pHScrl)
699 {
700 double visSizeX = double(pHScrl->GetVisibleSize());
701 double ratioX = deltaXInPixels / double(winSize.getWidth());
702 tools::Long deltaXInLogic = tools::Long(visSizeX * ratioX);
703 // Touch need to work by pixels. Did not apply this to
704 // Android, as android code may require adaptations
705 // to work with this scrolling code
706#ifndef IOS
707 tools::Long lineSizeX = pHScrl->GetLineSize();
708
709 if(lineSizeX)
710 {
711 deltaXInLogic /= lineSizeX;
712 }
713 else
714 {
715 deltaXInLogic = 0;
716 }
717#endif
718 if ( deltaXInLogic)
719 {
720#ifndef IOS
721 bool const isMultiplyByLineSize = true;
722#else
723 bool const isMultiplyByLineSize = false;
724#endif
725 lcl_HandleScrollHelper( pHScrl, deltaXInLogic, isMultiplyByLineSize );
726 bRet = true;
727 }
728 }
729 if(pVScrl)
730 {
731 double visSizeY = double(pVScrl->GetVisibleSize());
732 double ratioY = deltaYInPixels / double(winSize.getHeight());
733 tools::Long deltaYInLogic = tools::Long(visSizeY * ratioY);
734
735 // Touch need to work by pixels. Did not apply this to
736 // Android, as android code may require adaptations
737 // to work with this scrolling code
738#ifndef IOS
739 tools::Long lineSizeY = pVScrl->GetLineSize();
740 if(lineSizeY)
741 {
742 deltaYInLogic /= lineSizeY;
743 }
744 else
745 {
746 deltaYInLogic = 0;
747 }
748#endif
749 if ( deltaYInLogic )
750 {
751#ifndef IOS
752 bool const isMultiplyByLineSize = true;
753#else
754 bool const isMultiplyByLineSize = false;
755#endif
756 lcl_HandleScrollHelper( pVScrl, deltaYInLogic, isMultiplyByLineSize );
757
758 bRet = true;
759 }
760 }
761 }
762 }
763 }
764 break;
765
767 {
768 if (pVScrl)
769 {
771 if (pData->meEventType == GestureEventPanType::Begin)
772 {
773 mpWindowImpl->mpFrameData->mnTouchPanPosition = pVScrl->GetThumbPos();
774 }
775 else if(pData->meEventType == GestureEventPanType::Update)
776 {
777 tools::Long nOriginalPosition = mpWindowImpl->mpFrameData->mnTouchPanPosition;
778 pVScrl->DoScroll(nOriginalPosition + (pData->mfOffset / pVScrl->GetVisibleSize()));
779 }
780 if (pData->meEventType == GestureEventPanType::End)
781 {
782 mpWindowImpl->mpFrameData->mnTouchPanPosition = -1;
783 }
784 bRet = true;
785 }
786 break;
787 }
788
790 {
792 if ( pData && (pData->GetDeltaX() || pData->GetDeltaY()) )
793 {
794 ImplHandleScroll( pHScrl, pData->GetDeltaX(),
795 pVScrl, pData->GetDeltaY() );
796 bRet = true;
797 }
798 }
799 break;
800
801 default:
802 break;
803 }
804 }
805
806 return bRet;
807}
808
809// Note that when called for CommandEventId::Wheel above, despite its name,
810// pVScrl isn't necessarily the vertical scroll bar. Depending on
811// whether the scroll is horizontal or vertical, it is either the
812// horizontal or vertical scroll bar. nY is correspondingly either
813// the horizontal or vertical scroll amount.
814
815void Window::ImplHandleScroll( Scrollable* pHScrl, double nX,
816 Scrollable* pVScrl, double nY )
817{
818 lcl_HandleScrollHelper( pHScrl, nX, true );
819 lcl_HandleScrollHelper( pVScrl, nY, true );
820}
821
823{
824 return ImplGetDockingManager();
825}
826
827void Window::EnableDocking( bool bEnable )
828{
829 // update list of dockable windows
830 if( bEnable )
832 else
834}
835
836// retrieves the list of owner draw decorated windows for this window hierarchy
837::std::vector<VclPtr<vcl::Window> >& Window::ImplGetOwnerDrawList()
838{
839 return ImplGetTopmostFrameWindow()->mpWindowImpl->mpFrameData->maOwnerDrawList;
840}
841
842void Window::SetHelpId( const OString& rHelpId )
843{
844 mpWindowImpl->maHelpId = rHelpId;
845}
846
847const OString& Window::GetHelpId() const
848{
849 return mpWindowImpl->maHelpId;
850}
851
852// --------- old inline methods ---------------
853
855{
856 if ( mpWindowImpl->mpClientWindow )
857 return mpWindowImpl->mpClientWindow;
858 else
859 return const_cast<vcl::Window*>(this);
860}
861
863{
864 return mpWindowImpl ? mpWindowImpl->mpFrameData : nullptr;
865}
866
868{
869 return mpWindowImpl ? mpWindowImpl->mpFrame : nullptr;
870}
871
873{
874 SalFrame* pFrame = ImplGetFrame();
875 return pFrame ? pFrame->GetFrameWeld() : nullptr;
876}
877
879{
880 SalFrame* pFrame = ImplGetFrame();
881 return pFrame ? pFrame->GetWindow() : nullptr;
882}
883
885{
886 return mpWindowImpl ? mpWindowImpl->mpParent.get() : nullptr;
887}
888
890{
891 return mpWindowImpl ? mpWindowImpl->mpClientWindow.get() : nullptr;
892}
893
895{
896 return mpWindowImpl ? mpWindowImpl->mpBorderWindow.get() : nullptr;
897}
898
900{
901 if (!mpWindowImpl)
902 {
903 return nullptr;
904 }
905
906 if ( mpWindowImpl->mbOverlapWin )
907 return this;
908 else
909 return mpWindowImpl->mpOverlapWindow;
910}
911
913{
914 if (!mpWindowImpl)
915 {
916 return nullptr;
917 }
918
919 if ( mpWindowImpl->mbOverlapWin )
920 return this;
921 else
922 return mpWindowImpl->mpOverlapWindow;
923}
924
926{
927 return mpWindowImpl ? mpWindowImpl->mpFrameWindow.get() : nullptr;
928}
929
931{
932 return mpWindowImpl && mpWindowImpl->mbDockWin;
933}
934
936{
937 return mpWindowImpl && mpWindowImpl->mbFloatWin;
938}
939
941{
942 return mpWindowImpl && mpWindowImpl->mbSplitter;
943}
944
946{
947 return mpWindowImpl && mpWindowImpl->mbPushButton;
948}
949
951{
952 return mpWindowImpl && mpWindowImpl->mbOverlapWin;
953}
954
955void Window::ImplSetMouseTransparent( bool bTransparent )
956{
957 if (mpWindowImpl)
958 mpWindowImpl->mbMouseTransparent = bTransparent;
959}
960
962{
963 return Point( rPos.X()+GetOutDev()->mnOutOffX, rPos.Y()+GetOutDev()->mnOutOffY );
964}
965
967{
968 return Point( rPos.X()-GetOutDev()->mnOutOffX, rPos.Y()-GetOutDev()->mnOutOffY );
969}
970
971void Window::SetCompoundControl( bool bCompound )
972{
973 if (mpWindowImpl)
974 mpWindowImpl->mbCompoundControl = bCompound;
975}
976
978{
979 return mpWindowImpl ? mpWindowImpl->mnStyle : 0;
980}
981
983{
984 return mpWindowImpl ? mpWindowImpl->mnPrevStyle : 0;
985}
986
988{
989 return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : WindowExtendedStyle::NONE;
990}
991
993{
994 if (mpWindowImpl)
995 mpWindowImpl->mnType = nType;
996}
997
999{
1000 if (mpWindowImpl)
1001 return mpWindowImpl->mnType;
1002 else
1003 return WindowType::NONE;
1004}
1005
1007{
1008 const vcl::Window *pWindow = this;
1009
1010 while( pWindow )
1011 {
1012 if( pWindow->IsDialog() )
1013 break;
1014
1015 pWindow = pWindow->GetParent();
1016 }
1017
1018 return const_cast<Dialog *>(dynamic_cast<const Dialog*>(pWindow));
1019}
1020
1022{
1023 return mpWindowImpl && mpWindowImpl->mbSysWin;
1024}
1025
1027{
1028 return mpWindowImpl && mpWindowImpl->mbDialog;
1029}
1030
1032{
1033 return mpWindowImpl && mpWindowImpl->mbMenuFloatingWindow;
1034}
1035
1037{
1038 return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow;
1039}
1040
1042{
1043 mpWindowImpl->mbAllResize = true;
1044}
1045
1047{
1048 mpWindowImpl->mbChildTransparent = bEnable;
1049}
1050
1052{
1053 return mpWindowImpl && mpWindowImpl->mbChildTransparent;
1054}
1055
1057{
1058 return mpWindowImpl && mpWindowImpl->mbMouseTransparent;
1059}
1060
1062{
1063 return mpWindowImpl && mpWindowImpl->mbPaintTransparent;
1064}
1065
1067{
1068 mpWindowImpl->mbDlgCtrlStart = bStart;
1069}
1070
1072{
1073 return mpWindowImpl && mpWindowImpl->mbDlgCtrlStart;
1074}
1075
1077{
1078 mpWindowImpl->mnDlgCtrlFlags = nFlags;
1079}
1080
1082{
1083 return mpWindowImpl->mnDlgCtrlFlags;
1084}
1085
1087{
1088 return mpWindowImpl->maInputContext;
1089}
1090
1092{
1093 return bool(mpWindowImpl->mpControlFont);
1094}
1095
1097{
1098 return mpWindowImpl->maControlForeground;
1099}
1100
1102{
1103 return mpWindowImpl->mbControlForeground;
1104}
1105
1107{
1108 return mpWindowImpl->maControlBackground;
1109}
1110
1112{
1113 return mpWindowImpl->mbControlBackground;
1114}
1115
1117{
1118 return mpWindowImpl && mpWindowImpl->mbInPaint;
1119}
1120
1122{
1123 return mpWindowImpl ? mpWindowImpl->mpRealParent.get() : nullptr;
1124}
1125
1127{
1128 return mpWindowImpl && mpWindowImpl->mbVisible;
1129}
1130
1132{
1133 return mpWindowImpl && mpWindowImpl->mbReallyVisible;
1134}
1135
1137{
1138 return mpWindowImpl && mpWindowImpl->mbReallyShown;
1139}
1140
1142{
1143 return mpWindowImpl->mbInInitShow;
1144}
1145
1147{
1148 return mpWindowImpl && !mpWindowImpl->mbDisabled;
1149}
1150
1152{
1153 return mpWindowImpl && !mpWindowImpl->mbInputDisabled;
1154}
1155
1157{
1158 return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
1159}
1160
1162{
1163 return mpWindowImpl->mnActivateMode;
1164
1165}
1166
1168{
1169 return mpWindowImpl->mbAlwaysOnTop;
1170}
1171
1173{
1174 return mpWindowImpl->mbDefPos;
1175}
1176
1178{
1179 return mpWindowImpl->mbDefSize;
1180}
1181
1183{
1184 return Point(GetOutOffXPixel() - rWindow.GetOutOffXPixel(), GetOutOffYPixel() - rWindow.GetOutOffYPixel());
1185}
1186
1187void Window::EnablePaint( bool bEnable )
1188{
1189 mpWindowImpl->mbPaintDisabled = !bEnable;
1190}
1191
1193{
1194 return !mpWindowImpl->mbPaintDisabled;
1195}
1196
1198{
1199 return !mpWindowImpl->mbNoUpdate;
1200}
1201
1203{
1204 mpWindowImpl->mbNoParentUpdate = !bUpdate;
1205}
1206
1208{
1209 return mpWindowImpl->mbActive;
1210}
1211
1213{
1214 return mpWindowImpl->mnGetFocusFlags;
1215}
1216
1218{
1219 return mpWindowImpl && mpWindowImpl->mbCompoundControl;
1220}
1221
1222bool Window::IsWait() const
1223{
1224 return (mpWindowImpl->mnWaitCount != 0);
1225}
1226
1228{
1229 if (!mpWindowImpl)
1230 return nullptr;
1231 return mpWindowImpl->mpCursor;
1232}
1233
1235{
1236 return mpWindowImpl->maZoom;
1237}
1238
1239bool Window::IsZoom() const
1240{
1241 return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
1242}
1243
1244void Window::SetHelpText( const OUString& rHelpText )
1245{
1246 mpWindowImpl->maHelpText = rHelpText;
1247 mpWindowImpl->mbHelpTextDynamic = true;
1248}
1249
1250void Window::SetQuickHelpText( const OUString& rHelpText )
1251{
1252 if (mpWindowImpl)
1253 mpWindowImpl->maQuickHelpText = rHelpText;
1254}
1255
1256const OUString& Window::GetQuickHelpText() const
1257{
1258 return mpWindowImpl->maQuickHelpText;
1259}
1260
1262{
1263 return mpWindowImpl->mbCreatedWithToolkit;
1264}
1265
1267{
1268 mpWindowImpl->mbCreatedWithToolkit = b;
1269}
1270
1272{
1273 return mpWindowImpl->maPointer;
1274}
1275
1277{
1278 return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : nullptr;
1279}
1280
1281void Window::SetPosPixel( const Point& rNewPos )
1282{
1283 setPosSizePixel( rNewPos.X(), rNewPos.Y(), 0, 0, PosSizeFlags::Pos );
1284}
1285
1286void Window::SetSizePixel( const Size& rNewSize )
1287{
1288 setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(),
1290}
1291
1292void Window::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
1293{
1294 setPosSizePixel( rNewPos.X(), rNewPos.Y(),
1295 rNewSize.Width(), rNewSize.Height());
1296}
1297
1298void Window::SetOutputSizePixel( const Size& rNewSize )
1299{
1300 SetSizePixel( Size( rNewSize.Width()+mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder,
1301 rNewSize.Height()+mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder ) );
1302}
1303
1304//When a widget wants to renegotiate layout, get toplevel parent dialog and call
1305//resize on it. Mark all intermediate containers (or container-alike) widgets
1306//as dirty for the size remains unchanged, but layout changed circumstances
1307namespace
1308{
1309 bool queue_ungrouped_resize(vcl::Window const *pOrigWindow)
1310 {
1311 bool bSomeoneCares = false;
1312
1313 vcl::Window *pWindow = pOrigWindow->GetParent();
1314 if (pWindow)
1315 {
1316 if (isContainerWindow(*pWindow))
1317 {
1318 bSomeoneCares = true;
1319 }
1320 else if (pWindow->GetType() == WindowType::TABCONTROL)
1321 {
1322 bSomeoneCares = true;
1323 }
1324 pWindow->queue_resize();
1325 }
1326
1327 return bSomeoneCares;
1328 }
1329}
1330
1332{
1333 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1334 pWindowImpl->mnOptimalWidthCache = -1;
1335 pWindowImpl->mnOptimalHeightCache = -1;
1336}
1337
1338static bool HasParentDockingWindow(const vcl::Window* pWindow)
1339{
1340 while( pWindow )
1341 {
1342 if( pWindow->IsDockingWindow() )
1343 return true;
1344
1345 pWindow = pWindow->GetParent();
1346 }
1347
1348 return false;
1349}
1350
1352{
1353 if (isDisposed())
1354 return;
1355
1356 bool bSomeoneCares = queue_ungrouped_resize(this);
1357
1358 if (eReason != StateChangedType::Visible)
1359 {
1361 }
1362
1363 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1364 if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VclSizeGroupMode::NONE)
1365 {
1366 std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1367 for (VclPtr<vcl::Window> const & pOther : rWindows)
1368 {
1369 if (pOther == this)
1370 continue;
1371 queue_ungrouped_resize(pOther);
1372 }
1373 }
1374
1375 if (bSomeoneCares && !isDisposed())
1376 {
1377 //fdo#57090 force a resync of the borders of the borderwindow onto this
1378 //window in case they have changed
1379 vcl::Window* pBorderWindow = ImplGetBorderWindow();
1380 if (pBorderWindow)
1381 pBorderWindow->Resize();
1382 }
1384 {
1385 Size aSize = GetSizePixel();
1386 if (!aSize.IsEmpty() && !pParent->IsInInitShow()
1388 LogicInvalidate(nullptr);
1389 }
1390}
1391
1392namespace
1393{
1394 VclAlign toAlign(std::u16string_view rValue)
1395 {
1396 VclAlign eRet = VclAlign::Fill;
1397
1398 if (rValue == u"fill")
1399 eRet = VclAlign::Fill;
1400 else if (rValue == u"start")
1401 eRet = VclAlign::Start;
1402 else if (rValue == u"end")
1403 eRet = VclAlign::End;
1404 else if (rValue == u"center")
1405 eRet = VclAlign::Center;
1406 return eRet;
1407 }
1408}
1409
1410bool Window::set_font_attribute(const OString &rKey, std::u16string_view rValue)
1411{
1412 if (rKey == "weight")
1413 {
1414 vcl::Font aFont(GetControlFont());
1415 if (rValue == u"thin")
1416 aFont.SetWeight(WEIGHT_THIN);
1417 else if (rValue == u"ultralight")
1419 else if (rValue == u"light")
1420 aFont.SetWeight(WEIGHT_LIGHT);
1421 else if (rValue == u"book")
1423 else if (rValue == u"normal")
1424 aFont.SetWeight(WEIGHT_NORMAL);
1425 else if (rValue == u"medium")
1426 aFont.SetWeight(WEIGHT_MEDIUM);
1427 else if (rValue == u"semibold")
1429 else if (rValue == u"bold")
1430 aFont.SetWeight(WEIGHT_BOLD);
1431 else if (rValue == u"ultrabold")
1433 else
1434 aFont.SetWeight(WEIGHT_BLACK);
1435 SetControlFont(aFont);
1436 }
1437 else if (rKey == "style")
1438 {
1439 vcl::Font aFont(GetControlFont());
1440 if (rValue == u"normal")
1441 aFont.SetItalic(ITALIC_NONE);
1442 else if (rValue == u"oblique")
1444 else if (rValue == u"italic")
1445 aFont.SetItalic(ITALIC_NORMAL);
1446 SetControlFont(aFont);
1447 }
1448 else if (rKey == "underline")
1449 {
1450 vcl::Font aFont(GetControlFont());
1452 SetControlFont(aFont);
1453 }
1454 else if (rKey == "scale")
1455 {
1456 // if no control font was set yet, take the underlying font from the device
1458 aFont.SetFontHeight(aFont.GetFontHeight() * o3tl::toDouble(rValue));
1459 SetControlFont(aFont);
1460 }
1461 else if (rKey == "size")
1462 {
1463 vcl::Font aFont(GetControlFont());
1464 sal_Int32 nHeight = o3tl::toInt32(rValue) / 1000;
1465 aFont.SetFontHeight(nHeight);
1466 SetControlFont(aFont);
1467 }
1468 else
1469 {
1470 SAL_INFO("vcl.layout", "unhandled font attribute: " << rKey);
1471 return false;
1472 }
1473 return true;
1474}
1475
1476bool Window::set_property(const OString &rKey, const OUString &rValue)
1477{
1478 if ((rKey == "label") || (rKey == "title") || (rKey == "text") )
1479 {
1481 }
1482 else if (rKey == "visible")
1483 Show(toBool(rValue));
1484 else if (rKey == "sensitive")
1485 Enable(toBool(rValue));
1486 else if (rKey == "resizable")
1487 {
1488 WinBits nBits = GetStyle();
1489 nBits &= ~WB_SIZEABLE;
1490 if (toBool(rValue))
1491 nBits |= WB_SIZEABLE;
1492 SetStyle(nBits);
1493 }
1494 else if (rKey == "xalign")
1495 {
1496 WinBits nBits = GetStyle();
1497 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1498
1499 float f = rValue.toFloat();
1500 assert(f == 0.0 || f == 1.0 || f == 0.5);
1501 if (f == 0.0)
1502 nBits |= WB_LEFT;
1503 else if (f == 1.0)
1504 nBits |= WB_RIGHT;
1505 else if (f == 0.5)
1506 nBits |= WB_CENTER;
1507
1508 SetStyle(nBits);
1509 }
1510 else if (rKey == "justification")
1511 {
1512 WinBits nBits = GetStyle();
1513 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1514
1515 if (rValue == "left")
1516 nBits |= WB_LEFT;
1517 else if (rValue == "right")
1518 nBits |= WB_RIGHT;
1519 else if (rValue == "center")
1520 nBits |= WB_CENTER;
1521
1522 SetStyle(nBits);
1523 }
1524 else if (rKey == "yalign")
1525 {
1526 WinBits nBits = GetStyle();
1527 nBits &= ~(WB_TOP | WB_VCENTER | WB_BOTTOM);
1528
1529 float f = rValue.toFloat();
1530 assert(f == 0.0 || f == 1.0 || f == 0.5);
1531 if (f == 0.0)
1532 nBits |= WB_TOP;
1533 else if (f == 1.0)
1534 nBits |= WB_BOTTOM;
1535 else if (f == 0.5)
1536 nBits |= WB_VCENTER;
1537
1538 SetStyle(nBits);
1539 }
1540 else if (rKey == "wrap")
1541 {
1542 WinBits nBits = GetStyle();
1543 nBits &= ~WB_WORDBREAK;
1544 if (toBool(rValue))
1545 nBits |= WB_WORDBREAK;
1546 SetStyle(nBits);
1547 }
1548 else if (rKey == "height-request")
1549 set_height_request(rValue.toInt32());
1550 else if (rKey == "width-request")
1551 set_width_request(rValue.toInt32());
1552 else if (rKey == "hexpand")
1553 set_hexpand(toBool(rValue));
1554 else if (rKey == "vexpand")
1555 set_vexpand(toBool(rValue));
1556 else if (rKey == "halign")
1557 set_halign(toAlign(rValue));
1558 else if (rKey == "valign")
1559 set_valign(toAlign(rValue));
1560 else if (rKey == "tooltip-markup")
1561 SetQuickHelpText(rValue);
1562 else if (rKey == "tooltip-text")
1563 SetQuickHelpText(rValue);
1564 else if (rKey == "border-width")
1565 set_border_width(rValue.toInt32());
1566 else if (rKey == "margin-start" || rKey == "margin-left")
1567 {
1568 assert(rKey == "margin-start" && "margin-left deprecated in favor of margin-start");
1569 set_margin_start(rValue.toInt32());
1570 }
1571 else if (rKey == "margin-end" || rKey == "margin-right")
1572 {
1573 assert(rKey == "margin-end" && "margin-right deprecated in favor of margin-end");
1574 set_margin_end(rValue.toInt32());
1575 }
1576 else if (rKey == "margin-top")
1577 set_margin_top(rValue.toInt32());
1578 else if (rKey == "margin-bottom")
1579 set_margin_bottom(rValue.toInt32());
1580 else if (rKey == "hscrollbar-policy")
1581 {
1582 WinBits nBits = GetStyle();
1583 nBits &= ~(WB_AUTOHSCROLL|WB_HSCROLL);
1584 if (rValue == "always")
1585 nBits |= WB_HSCROLL;
1586 else if (rValue == "automatic")
1587 nBits |= WB_AUTOHSCROLL;
1588 SetStyle(nBits);
1589 }
1590 else if (rKey == "vscrollbar-policy")
1591 {
1592 WinBits nBits = GetStyle();
1593 nBits &= ~(WB_AUTOVSCROLL|WB_VSCROLL);
1594 if (rValue == "always")
1595 nBits |= WB_VSCROLL;
1596 else if (rValue == "automatic")
1597 nBits |= WB_AUTOVSCROLL;
1598 SetStyle(nBits);
1599 }
1600 else if (rKey == "accessible-name")
1601 {
1602 SetAccessibleName(rValue);
1603 }
1604 else if (rKey == "accessible-description")
1605 {
1607 }
1608 else if (rKey == "accessible-role")
1609 {
1610 sal_Int16 role = BuilderUtils::getRoleFromName(rValue.toUtf8());
1611 if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
1612 SetAccessibleRole(role);
1613 }
1614 else if (rKey == "use-markup")
1615 {
1616 //https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
1617 SAL_WARN_IF(toBool(rValue), "vcl.layout", "Use pango attributes instead of mark-up");
1618 }
1619 else if (rKey == "has-focus")
1620 {
1621 if (toBool(rValue))
1622 GrabFocus();
1623 }
1624 else if (rKey == "can-focus")
1625 {
1626 WinBits nBits = GetStyle();
1627 nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
1628 if (toBool(rValue))
1629 nBits |= WB_TABSTOP;
1630 else
1631 nBits |= WB_NOTABSTOP;
1632 SetStyle(nBits);
1633 }
1634 else
1635 {
1636 SAL_INFO("vcl.layout", "unhandled property: " << rKey);
1637 return false;
1638 }
1639 return true;
1640}
1641
1642void Window::set_height_request(sal_Int32 nHeightRequest)
1643{
1644 if (!mpWindowImpl)
1645 return;
1646
1647 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1648
1649 if ( pWindowImpl->mnHeightRequest != nHeightRequest )
1650 {
1651 pWindowImpl->mnHeightRequest = nHeightRequest;
1652 queue_resize();
1653 }
1654}
1655
1656void Window::set_width_request(sal_Int32 nWidthRequest)
1657{
1658 if (!mpWindowImpl)
1659 return;
1660
1661 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1662
1663 if ( pWindowImpl->mnWidthRequest != nWidthRequest )
1664 {
1665 pWindowImpl->mnWidthRequest = nWidthRequest;
1666 queue_resize();
1667 }
1668}
1669
1671{
1673 if (aRet.Width() == -1 || aRet.Height() == -1)
1674 {
1675 //cache gets blown away by queue_resize
1676 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1677 if (pWindowImpl->mnOptimalWidthCache == -1 || pWindowImpl->mnOptimalHeightCache == -1)
1678 {
1679 Size aOptimal(GetOptimalSize());
1680 pWindowImpl->mnOptimalWidthCache = aOptimal.Width();
1681 pWindowImpl->mnOptimalHeightCache = aOptimal.Height();
1682 }
1683
1684 if (aRet.Width() == -1)
1685 aRet.setWidth( pWindowImpl->mnOptimalWidthCache );
1686 if (aRet.Height() == -1)
1687 aRet.setHeight( pWindowImpl->mnOptimalHeightCache );
1688 }
1689 return aRet;
1690}
1691
1693{
1695
1696 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1697 if (pWindowImpl->m_xSizeGroup)
1698 {
1699 const VclSizeGroupMode eMode = pWindowImpl->m_xSizeGroup->get_mode();
1701 {
1702 const bool bIgnoreInHidden = pWindowImpl->m_xSizeGroup->get_ignore_hidden();
1703 const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1704 for (auto const& window : rWindows)
1705 {
1706 const vcl::Window *pOther = window;
1707 if (pOther == this)
1708 continue;
1709 if (bIgnoreInHidden && !pOther->IsVisible())
1710 continue;
1711 Size aOtherSize = pOther->get_ungrouped_preferred_size();
1713 aRet.setWidth( std::max(aRet.Width(), aOtherSize.Width()) );
1715 aRet.setHeight( std::max(aRet.Height(), aOtherSize.Height()) );
1716 }
1717 }
1718 }
1719
1720 return aRet;
1721}
1722
1724{
1725 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1726 return pWindowImpl->meHalign;
1727}
1728
1730{
1731 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1732 pWindowImpl->meHalign = eAlign;
1733}
1734
1736{
1737 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1738 return pWindowImpl->meValign;
1739}
1740
1742{
1743 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1744 pWindowImpl->meValign = eAlign;
1745}
1746
1748{
1749 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1750 return pWindowImpl->mbHexpand;
1751}
1752
1753void Window::set_hexpand(bool bExpand)
1754{
1755 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1756 pWindowImpl->mbHexpand = bExpand;
1757}
1758
1760{
1761 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1762 return pWindowImpl->mbVexpand;
1763}
1764
1765void Window::set_vexpand(bool bExpand)
1766{
1767 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1768 pWindowImpl->mbVexpand = bExpand;
1769}
1770
1772{
1773 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1774 return pWindowImpl->mbExpand;
1775}
1776
1777void Window::set_expand(bool bExpand)
1778{
1779 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1780 pWindowImpl->mbExpand = bExpand;
1781}
1782
1784{
1785 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1786 return pWindowImpl->mePackType;
1787}
1788
1790{
1791 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1792 pWindowImpl->mePackType = ePackType;
1793}
1794
1795sal_Int32 Window::get_padding() const
1796{
1797 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1798 return pWindowImpl->mnPadding;
1799}
1800
1801void Window::set_padding(sal_Int32 nPadding)
1802{
1803 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1804 pWindowImpl->mnPadding = nPadding;
1805}
1806
1808{
1809 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1810 return pWindowImpl->mbFill;
1811}
1812
1813void Window::set_fill(bool bFill)
1814{
1815 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1816 pWindowImpl->mbFill = bFill;
1817}
1818
1819sal_Int32 Window::get_grid_width() const
1820{
1821 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1822 return pWindowImpl->mnGridWidth;
1823}
1824
1825void Window::set_grid_width(sal_Int32 nCols)
1826{
1827 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1828 pWindowImpl->mnGridWidth = nCols;
1829}
1830
1832{
1833 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1834 return pWindowImpl->mnGridLeftAttach;
1835}
1836
1837void Window::set_grid_left_attach(sal_Int32 nAttach)
1838{
1839 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1840 pWindowImpl->mnGridLeftAttach = nAttach;
1841}
1842
1844{
1845 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1846 return pWindowImpl->mnGridHeight;
1847}
1848
1849void Window::set_grid_height(sal_Int32 nRows)
1850{
1851 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1852 pWindowImpl->mnGridHeight = nRows;
1853}
1854
1856{
1857 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1858 return pWindowImpl->mnGridTopAttach;
1859}
1860
1861void Window::set_grid_top_attach(sal_Int32 nAttach)
1862{
1863 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1864 pWindowImpl->mnGridTopAttach = nAttach;
1865}
1866
1867void Window::set_border_width(sal_Int32 nBorderWidth)
1868{
1869 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1870 pWindowImpl->mnBorderWidth = nBorderWidth;
1871}
1872
1874{
1875 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1876 return pWindowImpl->mnBorderWidth;
1877}
1878
1879void Window::set_margin_start(sal_Int32 nWidth)
1880{
1881 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1882 if (pWindowImpl->mnMarginLeft != nWidth)
1883 {
1884 pWindowImpl->mnMarginLeft = nWidth;
1885 queue_resize();
1886 }
1887}
1888
1890{
1891 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1892 return pWindowImpl->mnMarginLeft;
1893}
1894
1895void Window::set_margin_end(sal_Int32 nWidth)
1896{
1897 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1898 if (pWindowImpl->mnMarginRight != nWidth)
1899 {
1900 pWindowImpl->mnMarginRight = nWidth;
1901 queue_resize();
1902 }
1903}
1904
1905sal_Int32 Window::get_margin_end() const
1906{
1907 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1908 return pWindowImpl->mnMarginRight;
1909}
1910
1911void Window::set_margin_top(sal_Int32 nWidth)
1912{
1913 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1914 if (pWindowImpl->mnMarginTop != nWidth)
1915 {
1916 pWindowImpl->mnMarginTop = nWidth;
1917 queue_resize();
1918 }
1919}
1920
1921sal_Int32 Window::get_margin_top() const
1922{
1923 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1924 return pWindowImpl->mnMarginTop;
1925}
1926
1927void Window::set_margin_bottom(sal_Int32 nWidth)
1928{
1929 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1930 if (pWindowImpl->mnMarginBottom != nWidth)
1931 {
1932 pWindowImpl->mnMarginBottom = nWidth;
1933 queue_resize();
1934 }
1935}
1936
1938{
1939 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1940 return pWindowImpl->mnMarginBottom;
1941}
1942
1944{
1945 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1946 return pWindowImpl->mnHeightRequest;
1947}
1948
1950{
1951 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1952 return pWindowImpl->mnWidthRequest;
1953}
1954
1956{
1957 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1958 return pWindowImpl->mbSecondary;
1959}
1960
1961void Window::set_secondary(bool bSecondary)
1962{
1963 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1964 pWindowImpl->mbSecondary = bSecondary;
1965}
1966
1968{
1969 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1970 return pWindowImpl->mbNonHomogeneous;
1971}
1972
1973void Window::set_non_homogeneous(bool bNonHomogeneous)
1974{
1975 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1976 pWindowImpl->mbNonHomogeneous = bNonHomogeneous;
1977}
1978
1979void Window::add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup)
1980{
1981 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1982 //To-Do, multiple groups
1983 pWindowImpl->m_xSizeGroup = xGroup;
1984 pWindowImpl->m_xSizeGroup->insert(this);
1985 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
1986 queue_resize();
1987}
1988
1990{
1991 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1992 //To-Do, multiple groups
1993 if (pWindowImpl->m_xSizeGroup)
1994 {
1995 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
1996 queue_resize();
1997 pWindowImpl->m_xSizeGroup->erase(this);
1998 pWindowImpl->m_xSizeGroup.reset();
1999 }
2000}
2001
2003{
2004 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2005 if (std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel)) != v.end())
2006 return;
2007 v.emplace_back(pLabel);
2008 pLabel->set_mnemonic_widget(this);
2009}
2010
2012{
2013 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2014 auto aFind = std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel));
2015 if (aFind == v.end())
2016 return;
2017 v.erase(aFind);
2018 pLabel->set_mnemonic_widget(nullptr);
2019}
2020
2021const std::vector<VclPtr<FixedText> >& Window::list_mnemonic_labels() const
2022{
2023 return mpWindowImpl->m_aMnemonicLabels;
2024}
2025
2026} /* namespace vcl */
2027
2028void InvertFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
2029{
2030 const int nBorder = 1;
2031 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2032 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Bottom()-nBorder+1), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2033 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2034 rRenderContext.Invert(tools::Rectangle(Point(rRect.Right()-nBorder+1, rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2035}
2036
2037/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool toBool(std::string_view rValue)
Definition: builder.cxx:91
constexpr int nBorderWidth
An auto-timer is a multi-shot timer re-emitting itself at interval until destroyed or stopped.
Definition: timer.hxx:67
bool IsTransparent() const
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
const CommandGesturePanData * GetGesturePanData() const
const CommandScrollData * GetAutoScrollData() const
void RemoveWindow(const vcl::Window *pWin)
Definition: dockmgr.cxx:394
void AddWindow(const vcl::Window *pWin)
Definition: dockmgr.cxx:386
void set_mnemonic_widget(vcl::Window *pWindow)
Definition: fixed.cxx:406
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
void ImplStop()
Definition: scrwnd.cxx:98
static sal_Int32 GetScrollRepeat()
static sal_Int32 GetButtonStartRepeat()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
virtual void InitClipRegion()
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
Definition: map.cxx:391
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
void Invert(const tools::Rectangle &rRect, InvertFlags nFlags=InvertFlags::NONE)
Definition: rect.cxx:149
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:183
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:938
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:672
void SetBackground()
Definition: background.cxx:27
OutDevType GetOutDevType() const
Definition: outdev.hxx:407
bool SelectClipRegion(const vcl::Region &, SalGraphics *pGraphics=nullptr)
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual weld::Window * GetFrameWeld() const
vcl::Window * GetWindow() const
Definition: salframe.hxx:297
void Invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice &rOutDev)
virtual tools::Long GetPageSize() const =0
virtual bool Inactive() const =0
virtual tools::Long GetThumbPos() const =0
virtual tools::Long GetLineSize() const =0
virtual tools::Long GetVisibleSize() const =0
virtual tools::Long DoScroll(tools::Long nNewPos)=0
virtual tools::Long GetRangeMax() const =0
bool IsEmpty() const
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
Definition: timer.hxx:27
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
void disposeAndClear()
Definition: vclptr.hxx:200
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
bool isDisposed() const
sal_Int32 mnGridTopAttach
Definition: window.h:310
bool mbFill
Definition: window.h:387
bool mbNonHomogeneous
Definition: window.h:389
bool mbExpand
Definition: window.h:386
VclPackType mePackType
Definition: window.h:306
bool mbVexpand
Definition: window.h:385
sal_Int32 mnGridLeftAttach
Definition: window.h:309
sal_Int32 mnGridHeight
Definition: window.h:308
sal_Int32 mnOptimalWidthCache
Definition: window.h:270
bool mbSecondary
Definition: window.h:388
sal_Int32 mnPadding
Definition: window.h:307
sal_Int32 mnOptimalHeightCache
Definition: window.h:271
sal_Int32 mnWidthRequest
Definition: window.h:268
bool mbHexpand
Definition: window.h:384
sal_Int32 mnMarginLeft
Definition: window.h:313
sal_Int32 mnMarginRight
Definition: window.h:314
sal_Int32 mnHeightRequest
Definition: window.h:269
VclAlign meHalign
Definition: window.h:304
sal_Int32 mnMarginBottom
Definition: window.h:316
sal_Int32 mnGridWidth
Definition: window.h:311
sal_Int32 mnBorderWidth
Definition: window.h:312
sal_Int32 mnMarginTop
Definition: window.h:315
VclAlign meValign
Definition: window.h:305
std::shared_ptr< VclSizeGroup > m_xSizeGroup
Definition: window.h:283
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
tools::Long GetFontHeight() const
Definition: font/font.cxx:933
void SetFontSize(const Size &)
Definition: font/font.cxx:149
void Merge(const Font &rFont)
Definition: font/font.cxx:388
void SetItalic(FontItalic)
Definition: font/font.cxx:278
void SetWeight(FontWeight)
Definition: font/font.cxx:266
void SetFontHeight(tools::Long nHeight)
Definition: font/font.cxx:932
void SetUnderline(FontLineStyle)
Definition: font/font.cxx:296
const Size & GetFontSize() const
Definition: font/font.cxx:931
Size CalcOutputSize(const Size &rWinSz) const
Definition: window2.cxx:569
SAL_DLLPRIVATE void ImplInvertFocus(const tools::Rectangle &rRect)
Definition: mouse.cxx:176
void SetDialogControlStart(bool bStart)
Definition: window2.cxx:1066
void SetStyle(WinBits nStyle)
Definition: window.cxx:1964
SAL_DLLPRIVATE Point ImplOutputToFrame(const Point &rPos)
Definition: window2.cxx:961
SAL_DLLPRIVATE Point ImplFrameToOutput(const Point &rPos)
Definition: window2.cxx:966
bool IsToolbarFloatingWindow() const
Definition: window2.cxx:1036
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3709
bool IsReallyVisible() const
Definition: window2.cxx:1131
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
vcl::Window * GetParent() const
Definition: window2.cxx:1121
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1161
sal_Int32 get_padding() const
Definition: window2.cxx:1795
SAL_DLLPRIVATE bool ImplIsPushButton() const
Definition: window2.cxx:945
GetFocusFlags GetGetFocusFlags() const
Definition: window2.cxx:1212
tools::Long GetOutOffXPixel() const
Definition: window3.cxx:123
bool IsInputEnabled() const
Definition: window2.cxx:1151
void SetHelpText(const OUString &rHelpText)
Definition: window2.cxx:1244
const InputContext & GetInputContext() const
Definition: window2.cxx:1086
void SetControlForeground()
Definition: window2.cxx:481
bool IsTracking() const
Definition: window2.cxx:340
bool IsControlFont() const
Definition: window2.cxx:1091
WinBits GetPrevStyle() const
Definition: window2.cxx:982
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
Definition: window2.cxx:1182
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
Definition: window2.cxx:628
void SetControlFont()
Definition: window2.cxx:433
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
Definition: window2.cxx:293
void SetZoomedPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window2.cxx:403
bool IsPaintEnabled() const
Definition: window2.cxx:1192
void HideTracking()
Definition: window2.cxx:151
bool IsPaintTransparent() const
Definition: window2.cxx:1061
void set_halign(VclAlign eAlign)
Definition: window2.cxx:1729
WindowType GetType() const
Definition: window2.cxx:998
SAL_DLLPRIVATE ::std::vector< VclPtr< vcl::Window > > & ImplGetOwnerDrawList()
Definition: window2.cxx:837
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Definition: window2.cxx:553
void set_padding(sal_Int32 nPadding)
Definition: window2.cxx:1801
VCLXWindow * GetWindowPeer() const
Definition: window2.cxx:1276
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1286
virtual void Tracking(const TrackingEvent &rTEvt)
Definition: window.cxx:1934
virtual void Resize()
Definition: window.cxx:1837
static DockingManager * GetDockingManager()
Definition: window2.cxx:822
Size get_preferred_size() const
Definition: window2.cxx:1692
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:950
tools::Long CalcZoom(tools::Long n) const
Definition: window2.cxx:421
void set_border_width(sal_Int32 nBorderWidth)
Definition: window2.cxx:1867
void set_grid_left_attach(sal_Int32 nAttach)
Definition: window2.cxx:1837
Dialog * GetParentDialog() const
Definition: window2.cxx:1006
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:894
void HideFocus()
Definition: window2.cxx:95
void set_height_request(sal_Int32 nHeightRequest)
Definition: window2.cxx:1642
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1351
static VclPtr< vcl::Window > SaveFocus()
Definition: window2.cxx:375
void set_margin_bottom(sal_Int32 nWidth)
Definition: window2.cxx:1927
const Color & GetControlForeground() const
Definition: window2.cxx:1096
void GrabFocus()
Definition: window.cxx:2981
bool IsCompoundControl() const
Definition: window2.cxx:1217
void SetControlBackground()
Definition: window2.cxx:521
bool IsUpdateMode() const
Definition: window2.cxx:1197
bool IsChildTransparentModeEnabled() const
Definition: window2.cxx:1051
VclPackType get_pack_type() const
Definition: window2.cxx:1783
void set_margin_end(sal_Int32 nWidth)
Definition: window2.cxx:1895
void remove_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2011
SAL_DLLPRIVATE bool ImplIsSplitter() const
Definition: window2.cxx:940
sal_Int32 get_margin_end() const
Definition: window2.cxx:1905
void set_hexpand(bool bExpand)
Definition: window2.cxx:1753
vcl::Cursor * GetCursor() const
Definition: window2.cxx:1227
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
Definition: window2.cxx:577
sal_Int32 get_grid_height() const
Definition: window2.cxx:1843
void set_grid_height(sal_Int32 nRows)
Definition: window2.cxx:1849
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2435
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1261
bool set_font_attribute(const OString &rKey, std::u16string_view rValue)
Definition: window2.cxx:1410
void SetAccessibleDescription(const OUString &rDescr)
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1298
bool IsControlForeground() const
Definition: window2.cxx:1101
WinBits GetStyle() const
Definition: window2.cxx:977
const Fraction & GetZoom() const
Definition: window2.cxx:1234
static void EndSaveFocus(const VclPtr< vcl::Window > &xFocusWin)
Definition: window2.cxx:386
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2189
bool IsDialogControlStart() const
Definition: window2.cxx:1071
bool IsReallyShown() const
Definition: window2.cxx:1136
tools::Long GetOutOffYPixel() const
Definition: window3.cxx:124
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
Definition: window2.cxx:2021
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
Definition: window2.cxx:128
Size CalcWindowSize(const Size &rOutSz) const
Definition: window2.cxx:561
const OString & GetHelpId() const
Definition: window2.cxx:847
bool get_vexpand() const
Definition: window2.cxx:1759
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:884
vcl::Font GetControlFont() const
Definition: window2.cxx:462
vcl::Font GetPointFont(vcl::RenderContext const &rRenderContext) const
Definition: window.cxx:2182
bool IsDialog() const
Definition: window2.cxx:1026
bool IsZoom() const
Definition: window2.cxx:1239
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
Definition: window2.cxx:899
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set.
Definition: window.cxx:3263
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void set_pack_type(VclPackType ePackType)
Definition: window2.cxx:1789
bool IsInInitShow() const
Definition: window2.cxx:1141
Size get_ungrouped_preferred_size() const
Definition: window2.cxx:1670
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2668
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
void SetAccessibleName(const OUString &rName)
sal_Int32 get_margin_top() const
Definition: window2.cxx:1921
virtual void LogicInvalidate(const tools::Rectangle *pRectangle)
Notification about some rectangle of the output device got invalidated.Used for the main document win...
Definition: paint.cxx:1190
bool get_fill() const
Definition: window2.cxx:1807
bool get_secondary() const
Definition: window2.cxx:1955
SAL_DLLPRIVATE vcl::Window * ImplGetTopmostFrameWindow()
Definition: stacking.cxx:50
bool IsAlwaysOnTopEnabled() const
Definition: window2.cxx:1167
void SetAccessibleRole(sal_uInt16 nRole)
SAL_DLLPRIVATE ImplWinData * ImplGetWinData() const
Definition: window.cxx:1225
bool IsDockingWindow() const
Definition: window2.cxx:930
sal_Int32 get_margin_start() const
Definition: window2.cxx:1889
void SetZoom(const Fraction &rZoom)
Definition: window2.cxx:394
void SetHelpId(const OString &)
Definition: window2.cxx:842
void SetParentUpdateMode(bool bUpdate)
Definition: window2.cxx:1202
void set_margin_top(sal_Int32 nWidth)
Definition: window2.cxx:1911
sal_Int32 get_height_request() const
Definition: window2.cxx:1943
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
Definition: window2.cxx:1979
tools::Long GetDrawPixel(::OutputDevice const *pDev, tools::Long nPixels) const
Definition: window2.cxx:587
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:484
SalFrame * ImplGetFrame() const
Definition: window2.cxx:867
bool IsWait() const
Definition: window2.cxx:1222
void ReleaseMouse()
Definition: mouse.cxx:469
sal_Int32 get_grid_left_attach() const
Definition: window2.cxx:1831
sal_Int32 get_grid_top_attach() const
Definition: window2.cxx:1855
virtual void ShowFocus(const tools::Rectangle &rRect)
Definition: window2.cxx:53
void set_width_request(sal_Int32 nWidthRequest)
Definition: window2.cxx:1656
bool IsSystemWindow() const
Definition: window2.cxx:1021
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
sal_Int32 get_border_width() const
Definition: window2.cxx:1873
virtual Size GetSizePixel() const
Definition: window.cxx:2404
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1111
virtual bool set_property(const OString &rKey, const OUString &rValue)
Definition: window2.cxx:1476
DialogControlFlags GetDialogControlFlags() const
Definition: window2.cxx:1081
const Color & GetControlBackground() const
Definition: window2.cxx:1106
void remove_from_all_size_groups()
Definition: window2.cxx:1989
static SAL_DLLPRIVATE void ImplHandleScroll(Scrollable *pHScrl, double nX, Scrollable *pVScrl, double nY)
Definition: window2.cxx:815
SAL_DLLPRIVATE ImplFrameData * ImplGetFrameData()
Definition: window2.cxx:862
void EnableAllResize()
Definition: window2.cxx:1041
void SetCreatedWithToolkit(bool b)
Definition: window2.cxx:1266
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2175
sal_Int32 get_width_request() const
Definition: window2.cxx:1949
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:935
void set_secondary(bool bSecondary)
Definition: window2.cxx:1961
void StartAutoScroll(StartAutoScrollFlags nFlags)
Definition: window2.cxx:347
void set_margin_start(sal_Int32 nWidth)
Definition: window2.cxx:1879
VclAlign get_halign() const
Definition: window2.cxx:1723
sal_Int32 get_margin_bottom() const
Definition: window2.cxx:1937
bool get_expand() const
Definition: window2.cxx:1771
void set_expand(bool bExpand)
Definition: window2.cxx:1777
bool IsVisible() const
Definition: window2.cxx:1126
void EnableDocking(bool bEnable=true)
Definition: window2.cxx:827
bool get_non_homogeneous() const
Definition: window2.cxx:1967
void CaptureMouse()
Definition: mouse.cxx:451
bool IsDefaultPos() const
Definition: window2.cxx:1172
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1281
weld::Window * GetFrameWeld() const
Definition: window2.cxx:872
void set_grid_top_attach(sal_Int32 nAttach)
Definition: window2.cxx:1861
void SetQuickHelpText(const OUString &rHelpText)
Definition: window2.cxx:1250
void set_valign(VclAlign eAlign)
Definition: window2.cxx:1741
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3031
void set_fill(bool bFill)
Definition: window2.cxx:1813
vcl::Window * GetFrameWindow() const
Definition: window2.cxx:878
tools::Rectangle GetOutputRectPixel() const
Definition: window3.cxx:91
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
Definition: window2.cxx:473
void add_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2002
WindowExtendedStyle GetExtendedStyle() const
Definition: window2.cxx:987
void InvertTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags)
Definition: window2.cxx:162
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:854
void set_non_homogeneous(bool bNonHomogeneous)
Definition: window2.cxx:1973
bool IsDefaultSize() const
Definition: window2.cxx:1177
void SetType(WindowType nType)
Definition: window2.cxx:992
void SetDialogControlFlags(DialogControlFlags nFlags)
Definition: window2.cxx:1076
void set_vexpand(bool bExpand)
Definition: window2.cxx:1765
bool IsMenuFloatingWindow() const
Definition: window2.cxx:1031
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Definition: window2.cxx:513
void set_grid_width(sal_Int32 nCols)
Definition: window2.cxx:1825
const OUString & GetQuickHelpText() const
Definition: window2.cxx:1256
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1292
VclAlign get_valign() const
Definition: window2.cxx:1735
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
Definition: window2.cxx:889
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:925
void SetUseFrameData(bool bUseFrameData)
Definition: window2.cxx:246
PointerStyle GetPointer() const
Definition: window2.cxx:1271
SAL_DLLPRIVATE SalGraphics * ImplGetFrameGraphics() const
Definition: window.cxx:1288
bool IsActive() const
Definition: window2.cxx:1207
bool IsEnabled() const
Definition: window2.cxx:1146
sal_Int32 get_grid_width() const
Definition: window2.cxx:1819
bool IsAlwaysEnableInput() const
returns the current AlwaysEnableInput state
Definition: window2.cxx:1156
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1046
bool IsInPaint() const
Definition: window2.cxx:1116
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:971
void EndAutoScroll()
Definition: window2.cxx:362
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:955
void EnablePaint(bool bEnable)
Definition: window2.cxx:1187
void InvalidateSizeCache()
clear OptimalSize cache
Definition: window2.cxx:1331
bool IsMouseTransparent() const
Definition: window2.cxx:1056
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3897
bool get_hexpand() const
Definition: window2.cxx:1747
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define COMMAND_WHEEL_PAGESCROLL
float v
float u
GraphicsSharedPtr mpGraphics
LINESTYLE_SINGLE
LINESTYLE_NONE
ITALIC_NORMAL
ITALIC_NONE
ITALIC_OBLIQUE
WEIGHT_ULTRALIGHT
WEIGHT_ULTRABOLD
WEIGHT_THIN
WEIGHT_BOLD
WEIGHT_NORMAL
WEIGHT_LIGHT
WEIGHT_SEMIBOLD
WEIGHT_SEMILIGHT
WEIGHT_MEDIUM
WEIGHT_BLACK
tools::Long FRound(double fVal)
Mode eMode
sal_Int64 n
bool isContainerWindow(const vcl::Window &rWindow)
Definition: layout.hxx:816
const long LONG_MAX
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
sal_Int16 getRoleFromName(const OString &roleName)
Definition: builder.cxx:2305
OUString convertMnemonicMarkup(std::u16string_view rIn)
Definition: builder.cxx:2224
tools::Long const nBorder
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
double toDouble(std::u16string_view str)
long Long
IMPL_LINK(ORoadmap, ImplClickHdl, HyperLabel *, CurHyperLabel, void)
Definition: roadmap.cxx:634
static bool HasParentDockingWindow(const vcl::Window *pWindow)
Definition: window2.cxx:1338
static void lcl_HandleScrollHelper(Scrollable *pScrl, double nN, bool isMultiplyByLineSize)
Definition: window2.cxx:601
HashMap_OWString_Interface aMap
@ OUTDEV_WINDOW
Definition: outdev.hxx:144
PointerStyle
Definition: ptrstyle.hxx:26
QPRO_FUNC_TYPE nType
VclPtr< ImplWheelWindow > mpWheelWindow
Definition: svdata.hxx:152
ImplSVWinData * mpWinData
Definition: svdata.hxx:403
ImplSVAppData maAppData
Definition: svdata.hxx:400
StartAutoScrollFlags mnAutoScrollFlags
Definition: svdata.hxx:269
StartTrackingFlags mnTrackFlags
Definition: svdata.hxx:268
VclPtr< vcl::Window > mpAutoScrollWin
Definition: svdata.hxx:264
VclPtr< vcl::Window > mpFocusWin
Definition: svdata.hxx:255
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:261
AutoTimer * mpTrackTimer
Definition: svdata.hxx:262
std::optional< tools::Rectangle > mpTrackRect
Definition: window.h:117
std::optional< tools::Rectangle > mpFocusRect
Definition: window.h:115
ShowTrackFlags mnTrackFlags
Definition: window.h:118
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
DockingManager * ImplGetDockingManager()
Definition: svdata.cxx:315
VclAlign
Definition: vclenum.hxx:193
VclPackType
Definition: vclenum.hxx:201
TrackingEventFlags
Definition: vclenum.hxx:364
VclSizeGroupMode
Definition: vclenum.hxx:242
void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: window2.cxx:2028
@ AlwaysInputEnabled
Definition: window.h:201
GetFocusFlags
Definition: window.hxx:313
ShowTrackFlags
Definition: window.hxx:248
StartAutoScrollFlags
Definition: window.hxx:279
StartTrackingFlags
Definition: window.hxx:265
DialogControlFlags
Definition: window.hxx:333
ActivateModeFlags
Definition: window.hxx:160
StateChangedType
Definition: window.hxx:291
WindowExtendedStyle
Definition: window.hxx:413
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_TOP
Definition: wintypes.hxx:149
WinBits const WB_VCENTER
Definition: wintypes.hxx:150
WinBits const WB_CENTER
Definition: wintypes.hxx:147
WindowType
Definition: wintypes.hxx:27
WinBits const WB_SIZEABLE
Definition: wintypes.hxx:117
WinBits const WB_NOTABSTOP
Definition: wintypes.hxx:141
WinBits const WB_AUTOVSCROLL
Definition: wintypes.hxx:163
WinBits const WB_AUTOHSCROLL
Definition: wintypes.hxx:161
WinBits const WB_RIGHT
Definition: wintypes.hxx:148
WinBits const WB_WORDBREAK
Definition: wintypes.hxx:156
WinBits const WB_VSCROLL
Definition: wintypes.hxx:178
WinBits const WB_TABSTOP
Definition: wintypes.hxx:140
WinBits const WB_BOTTOM
Definition: wintypes.hxx:151
WinBits const WB_LEFT
Definition: wintypes.hxx:146
WinBits const WB_HSCROLL
Definition: wintypes.hxx:177