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
601// returns how much was actually scrolled (so that abs(retval) <= abs(nN))
602static double lcl_HandleScrollHelper( Scrollable* pScrl, double nN, bool isMultiplyByLineSize )
603{
604 if (!pScrl || !nN || pScrl->Inactive())
605 return 0.0;
606
607 tools::Long nNewPos = pScrl->GetThumbPos();
608 double scrolled = nN;
609
610 if ( nN == double(-LONG_MAX) )
611 nNewPos += pScrl->GetPageSize();
612 else if ( nN == double(LONG_MAX) )
613 nNewPos -= pScrl->GetPageSize();
614 else
615 {
616 // allowing both chunked and continuous scrolling
617 if(isMultiplyByLineSize){
618 nN*=pScrl->GetLineSize();
619 }
620
621 // compute how many quantized units to scroll
622 tools::Long magnitude = o3tl::saturating_cast<tools::Long>(abs(nN));
623 tools::Long change = copysign(magnitude, nN);
624
625 nNewPos = nNewPos - change;
626
627 scrolled = double(change);
628 // convert back to chunked/continuous
629 if(isMultiplyByLineSize){
630 scrolled /= pScrl->GetLineSize();
631 }
632 }
633
634 pScrl->DoScroll( nNewPos );
635
636 return scrolled;
637}
638
640 Scrollable* pHScrl, Scrollable* pVScrl )
641{
642 bool bRet = false;
643
644 if ( pHScrl || pVScrl )
645 {
646 switch( rCmd.GetCommand() )
647 {
649 {
651 if ( pHScrl )
652 {
653 if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
654 !pHScrl->Inactive() )
656 }
657 if ( pVScrl )
658 {
659 if ( (pVScrl->GetVisibleSize() < pVScrl->GetRangeMax()) &&
660 !pVScrl->Inactive() )
662 }
663
664 if ( nFlags != StartAutoScrollFlags::NONE )
665 {
666 StartAutoScroll( nFlags );
667 bRet = true;
668 }
669 }
670 break;
671
673 {
674 const CommandWheelData* pData = rCmd.GetWheelData();
675
676 if ( pData && (CommandWheelMode::SCROLL == pData->GetMode()) )
677 {
678 if (!pData->IsDeltaPixel())
679 {
680 double nScrollLines = pData->GetScrollLines();
681 double nLines;
682 double* partialScroll = pData->IsHorz()
683 ? &mpWindowImpl->mfPartialScrollX
684 : &mpWindowImpl->mfPartialScrollY;
685 if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
686 {
687 if ( pData->GetDelta() < 0 )
688 nLines = double(-LONG_MAX);
689 else
690 nLines = double(LONG_MAX);
691 }
692 else
693 nLines = *partialScroll + pData->GetNotchDelta() * nScrollLines;
694 if ( nLines )
695 {
696 Scrollable* pScrl = pData->IsHorz() ? pHScrl : pVScrl;
697 double scrolled = lcl_HandleScrollHelper( pScrl, nLines, true );
698 *partialScroll = nLines - scrolled;
699 bRet = true;
700 }
701 }
702 else
703 {
704 // Mobile / touch scrolling section
705 const Point & deltaPoint = rCmd.GetMousePosPixel();
706
707 double deltaXInPixels = double(deltaPoint.X());
708 double deltaYInPixels = double(deltaPoint.Y());
709 Size winSize = GetOutputSizePixel();
710
711 if(pHScrl)
712 {
713 double visSizeX = double(pHScrl->GetVisibleSize());
714 double ratioX = deltaXInPixels / double(winSize.getWidth());
715 tools::Long deltaXInLogic = tools::Long(visSizeX * ratioX);
716 // Touch need to work by pixels. Did not apply this to
717 // Android, as android code may require adaptations
718 // to work with this scrolling code
719#ifndef IOS
720 tools::Long lineSizeX = pHScrl->GetLineSize();
721
722 if(lineSizeX)
723 {
724 deltaXInLogic /= lineSizeX;
725 }
726 else
727 {
728 deltaXInLogic = 0;
729 }
730#endif
731 if ( deltaXInLogic)
732 {
733#ifndef IOS
734 bool const isMultiplyByLineSize = true;
735#else
736 bool const isMultiplyByLineSize = false;
737#endif
738 lcl_HandleScrollHelper( pHScrl, deltaXInLogic, isMultiplyByLineSize );
739 bRet = true;
740 }
741 }
742 if(pVScrl)
743 {
744 double visSizeY = double(pVScrl->GetVisibleSize());
745 double ratioY = deltaYInPixels / double(winSize.getHeight());
746 tools::Long deltaYInLogic = tools::Long(visSizeY * ratioY);
747
748 // Touch need to work by pixels. Did not apply this to
749 // Android, as android code may require adaptations
750 // to work with this scrolling code
751#ifndef IOS
752 tools::Long lineSizeY = pVScrl->GetLineSize();
753 if(lineSizeY)
754 {
755 deltaYInLogic /= lineSizeY;
756 }
757 else
758 {
759 deltaYInLogic = 0;
760 }
761#endif
762 if ( deltaYInLogic )
763 {
764#ifndef IOS
765 bool const isMultiplyByLineSize = true;
766#else
767 bool const isMultiplyByLineSize = false;
768#endif
769 lcl_HandleScrollHelper( pVScrl, deltaYInLogic, isMultiplyByLineSize );
770
771 bRet = true;
772 }
773 }
774 }
775 }
776 }
777 break;
778
780 {
781 if (pVScrl)
782 {
784 if (pData->meEventType == GestureEventPanType::Begin)
785 {
786 mpWindowImpl->mpFrameData->mnTouchPanPosition = pVScrl->GetThumbPos();
787 }
788 else if(pData->meEventType == GestureEventPanType::Update)
789 {
790 tools::Long nOriginalPosition = mpWindowImpl->mpFrameData->mnTouchPanPosition;
791 pVScrl->DoScroll(nOriginalPosition + (pData->mfOffset / pVScrl->GetVisibleSize()));
792 }
793 if (pData->meEventType == GestureEventPanType::End)
794 {
795 mpWindowImpl->mpFrameData->mnTouchPanPosition = -1;
796 }
797 bRet = true;
798 }
799 break;
800 }
801
803 {
805 if ( pData && (pData->GetDeltaX() || pData->GetDeltaY()) )
806 {
807 ImplHandleScroll( pHScrl, pData->GetDeltaX(),
808 pVScrl, pData->GetDeltaY() );
809 bRet = true;
810 }
811 }
812 break;
813
814 default:
815 break;
816 }
817 }
818
819 return bRet;
820}
821
822void Window::ImplHandleScroll( Scrollable* pHScrl, double nX,
823 Scrollable* pVScrl, double nY )
824{
825 lcl_HandleScrollHelper( pHScrl, nX, true );
826 lcl_HandleScrollHelper( pVScrl, nY, true );
827}
828
830{
831 return ImplGetDockingManager();
832}
833
834void Window::EnableDocking( bool bEnable )
835{
836 // update list of dockable windows
837 if( bEnable )
839 else
841}
842
843// retrieves the list of owner draw decorated windows for this window hierarchy
844::std::vector<VclPtr<vcl::Window> >& Window::ImplGetOwnerDrawList()
845{
846 return ImplGetTopmostFrameWindow()->mpWindowImpl->mpFrameData->maOwnerDrawList;
847}
848
849void Window::SetHelpId( const OString& rHelpId )
850{
851 mpWindowImpl->maHelpId = rHelpId;
852}
853
854const OString& Window::GetHelpId() const
855{
856 return mpWindowImpl->maHelpId;
857}
858
859// --------- old inline methods ---------------
860
862{
863 if ( mpWindowImpl->mpClientWindow )
864 return mpWindowImpl->mpClientWindow;
865 else
866 return const_cast<vcl::Window*>(this);
867}
868
870{
871 return mpWindowImpl ? mpWindowImpl->mpFrameData : nullptr;
872}
873
875{
876 return mpWindowImpl ? mpWindowImpl->mpFrame : nullptr;
877}
878
880{
881 SalFrame* pFrame = ImplGetFrame();
882 return pFrame ? pFrame->GetFrameWeld() : nullptr;
883}
884
886{
887 SalFrame* pFrame = ImplGetFrame();
888 return pFrame ? pFrame->GetWindow() : nullptr;
889}
890
892{
893 return mpWindowImpl ? mpWindowImpl->mpParent.get() : nullptr;
894}
895
897{
898 return mpWindowImpl ? mpWindowImpl->mpClientWindow.get() : nullptr;
899}
900
902{
903 return mpWindowImpl ? mpWindowImpl->mpBorderWindow.get() : nullptr;
904}
905
907{
908 if (!mpWindowImpl)
909 {
910 return nullptr;
911 }
912
913 if ( mpWindowImpl->mbOverlapWin )
914 return this;
915 else
916 return mpWindowImpl->mpOverlapWindow;
917}
918
920{
921 if (!mpWindowImpl)
922 {
923 return nullptr;
924 }
925
926 if ( mpWindowImpl->mbOverlapWin )
927 return this;
928 else
929 return mpWindowImpl->mpOverlapWindow;
930}
931
933{
934 return mpWindowImpl ? mpWindowImpl->mpFrameWindow.get() : nullptr;
935}
936
938{
939 return mpWindowImpl && mpWindowImpl->mbDockWin;
940}
941
943{
944 return mpWindowImpl && mpWindowImpl->mbFloatWin;
945}
946
948{
949 return mpWindowImpl && mpWindowImpl->mbSplitter;
950}
951
953{
954 return mpWindowImpl && mpWindowImpl->mbPushButton;
955}
956
958{
959 return mpWindowImpl && mpWindowImpl->mbOverlapWin;
960}
961
962void Window::ImplSetMouseTransparent( bool bTransparent )
963{
964 if (mpWindowImpl)
965 mpWindowImpl->mbMouseTransparent = bTransparent;
966}
967
969{
970 return Point( rPos.X()+GetOutDev()->mnOutOffX, rPos.Y()+GetOutDev()->mnOutOffY );
971}
972
974{
975 return Point( rPos.X()-GetOutDev()->mnOutOffX, rPos.Y()-GetOutDev()->mnOutOffY );
976}
977
978void Window::SetCompoundControl( bool bCompound )
979{
980 if (mpWindowImpl)
981 mpWindowImpl->mbCompoundControl = bCompound;
982}
983
985{
986 return mpWindowImpl ? mpWindowImpl->mnStyle : 0;
987}
988
990{
991 return mpWindowImpl ? mpWindowImpl->mnPrevStyle : 0;
992}
993
995{
996 return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : WindowExtendedStyle::NONE;
997}
998
1000{
1001 if (mpWindowImpl)
1002 mpWindowImpl->mnType = nType;
1003}
1004
1006{
1007 if (mpWindowImpl)
1008 return mpWindowImpl->mnType;
1009 else
1010 return WindowType::NONE;
1011}
1012
1014{
1015 const vcl::Window *pWindow = this;
1016
1017 while( pWindow )
1018 {
1019 if( pWindow->IsDialog() )
1020 break;
1021
1022 pWindow = pWindow->GetParent();
1023 }
1024
1025 return const_cast<Dialog *>(dynamic_cast<const Dialog*>(pWindow));
1026}
1027
1029{
1030 return mpWindowImpl && mpWindowImpl->mbSysWin;
1031}
1032
1034{
1035 return mpWindowImpl && mpWindowImpl->mbDialog;
1036}
1037
1039{
1040 return mpWindowImpl && mpWindowImpl->mbMenuFloatingWindow;
1041}
1042
1044{
1045 return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow;
1046}
1047
1049{
1050 mpWindowImpl->mbAllResize = true;
1051}
1052
1054{
1055 mpWindowImpl->mbChildTransparent = bEnable;
1056}
1057
1059{
1060 return mpWindowImpl && mpWindowImpl->mbChildTransparent;
1061}
1062
1064{
1065 return mpWindowImpl && mpWindowImpl->mbMouseTransparent;
1066}
1067
1069{
1070 return mpWindowImpl && mpWindowImpl->mbPaintTransparent;
1071}
1072
1074{
1075 mpWindowImpl->mbDlgCtrlStart = bStart;
1076}
1077
1079{
1080 return mpWindowImpl && mpWindowImpl->mbDlgCtrlStart;
1081}
1082
1084{
1085 mpWindowImpl->mnDlgCtrlFlags = nFlags;
1086}
1087
1089{
1090 return mpWindowImpl->mnDlgCtrlFlags;
1091}
1092
1094{
1095 return mpWindowImpl->maInputContext;
1096}
1097
1099{
1100 return bool(mpWindowImpl->mpControlFont);
1101}
1102
1104{
1105 return mpWindowImpl->maControlForeground;
1106}
1107
1109{
1110 return mpWindowImpl->mbControlForeground;
1111}
1112
1114{
1115 return mpWindowImpl->maControlBackground;
1116}
1117
1119{
1120 return mpWindowImpl->mbControlBackground;
1121}
1122
1124{
1125 return mpWindowImpl && mpWindowImpl->mbInPaint;
1126}
1127
1129{
1130 return mpWindowImpl ? mpWindowImpl->mpRealParent.get() : nullptr;
1131}
1132
1134{
1135 return mpWindowImpl && mpWindowImpl->mbVisible;
1136}
1137
1139{
1140 return mpWindowImpl && mpWindowImpl->mbReallyVisible;
1141}
1142
1144{
1145 return mpWindowImpl && mpWindowImpl->mbReallyShown;
1146}
1147
1149{
1150 return mpWindowImpl->mbInInitShow;
1151}
1152
1154{
1155 return mpWindowImpl && !mpWindowImpl->mbDisabled;
1156}
1157
1159{
1160 return mpWindowImpl && !mpWindowImpl->mbInputDisabled;
1161}
1162
1164{
1165 return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
1166}
1167
1169{
1170 return mpWindowImpl->mnActivateMode;
1171
1172}
1173
1175{
1176 return mpWindowImpl->mbAlwaysOnTop;
1177}
1178
1180{
1181 return mpWindowImpl->mbDefPos;
1182}
1183
1185{
1186 return mpWindowImpl->mbDefSize;
1187}
1188
1190{
1191 return Point(GetOutOffXPixel() - rWindow.GetOutOffXPixel(), GetOutOffYPixel() - rWindow.GetOutOffYPixel());
1192}
1193
1194void Window::EnablePaint( bool bEnable )
1195{
1196 mpWindowImpl->mbPaintDisabled = !bEnable;
1197}
1198
1200{
1201 return !mpWindowImpl->mbPaintDisabled;
1202}
1203
1205{
1206 return !mpWindowImpl->mbNoUpdate;
1207}
1208
1210{
1211 mpWindowImpl->mbNoParentUpdate = !bUpdate;
1212}
1213
1215{
1216 return mpWindowImpl->mbActive;
1217}
1218
1220{
1221 return mpWindowImpl->mnGetFocusFlags;
1222}
1223
1225{
1226 return mpWindowImpl && mpWindowImpl->mbCompoundControl;
1227}
1228
1229bool Window::IsWait() const
1230{
1231 return (mpWindowImpl->mnWaitCount != 0);
1232}
1233
1235{
1236 if (!mpWindowImpl)
1237 return nullptr;
1238 return mpWindowImpl->mpCursor;
1239}
1240
1242{
1243 return mpWindowImpl->maZoom;
1244}
1245
1246bool Window::IsZoom() const
1247{
1248 return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
1249}
1250
1251void Window::SetHelpText( const OUString& rHelpText )
1252{
1253 mpWindowImpl->maHelpText = rHelpText;
1254 mpWindowImpl->mbHelpTextDynamic = true;
1255}
1256
1257void Window::SetQuickHelpText( const OUString& rHelpText )
1258{
1259 if (mpWindowImpl)
1260 mpWindowImpl->maQuickHelpText = rHelpText;
1261}
1262
1263const OUString& Window::GetQuickHelpText() const
1264{
1265 return mpWindowImpl->maQuickHelpText;
1266}
1267
1269{
1270 return mpWindowImpl->mbCreatedWithToolkit;
1271}
1272
1274{
1275 mpWindowImpl->mbCreatedWithToolkit = b;
1276}
1277
1279{
1280 return mpWindowImpl->maPointer;
1281}
1282
1284{
1285 return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : nullptr;
1286}
1287
1288void Window::SetPosPixel( const Point& rNewPos )
1289{
1290 setPosSizePixel( rNewPos.X(), rNewPos.Y(), 0, 0, PosSizeFlags::Pos );
1291}
1292
1293void Window::SetSizePixel( const Size& rNewSize )
1294{
1295 setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(),
1297}
1298
1299void Window::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
1300{
1301 setPosSizePixel( rNewPos.X(), rNewPos.Y(),
1302 rNewSize.Width(), rNewSize.Height());
1303}
1304
1305void Window::SetOutputSizePixel( const Size& rNewSize )
1306{
1307 SetSizePixel( Size( rNewSize.Width()+mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder,
1308 rNewSize.Height()+mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder ) );
1309}
1310
1311//When a widget wants to renegotiate layout, get toplevel parent dialog and call
1312//resize on it. Mark all intermediate containers (or container-alike) widgets
1313//as dirty for the size remains unchanged, but layout changed circumstances
1314namespace
1315{
1316 bool queue_ungrouped_resize(vcl::Window const *pOrigWindow)
1317 {
1318 bool bSomeoneCares = false;
1319
1320 vcl::Window *pWindow = pOrigWindow->GetParent();
1321 if (pWindow)
1322 {
1323 if (isContainerWindow(*pWindow))
1324 {
1325 bSomeoneCares = true;
1326 }
1327 else if (pWindow->GetType() == WindowType::TABCONTROL)
1328 {
1329 bSomeoneCares = true;
1330 }
1331 pWindow->queue_resize();
1332 }
1333
1334 return bSomeoneCares;
1335 }
1336}
1337
1339{
1340 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1341 pWindowImpl->mnOptimalWidthCache = -1;
1342 pWindowImpl->mnOptimalHeightCache = -1;
1343}
1344
1345static bool HasParentDockingWindow(const vcl::Window* pWindow)
1346{
1347 while( pWindow )
1348 {
1349 if( pWindow->IsDockingWindow() )
1350 return true;
1351
1352 pWindow = pWindow->GetParent();
1353 }
1354
1355 return false;
1356}
1357
1359{
1360 if (isDisposed())
1361 return;
1362
1363 bool bSomeoneCares = queue_ungrouped_resize(this);
1364
1365 if (eReason != StateChangedType::Visible)
1366 {
1368 }
1369
1370 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1371 if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VclSizeGroupMode::NONE)
1372 {
1373 std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1374 for (VclPtr<vcl::Window> const & pOther : rWindows)
1375 {
1376 if (pOther == this)
1377 continue;
1378 queue_ungrouped_resize(pOther);
1379 }
1380 }
1381
1382 if (bSomeoneCares && !isDisposed())
1383 {
1384 //fdo#57090 force a resync of the borders of the borderwindow onto this
1385 //window in case they have changed
1386 vcl::Window* pBorderWindow = ImplGetBorderWindow();
1387 if (pBorderWindow)
1388 pBorderWindow->Resize();
1389 }
1391 {
1392 Size aSize = GetSizePixel();
1393 if (!aSize.IsEmpty() && !pParent->IsInInitShow()
1395 LogicInvalidate(nullptr);
1396 }
1397}
1398
1399namespace
1400{
1401 VclAlign toAlign(std::u16string_view rValue)
1402 {
1403 VclAlign eRet = VclAlign::Fill;
1404
1405 if (rValue == u"fill")
1406 eRet = VclAlign::Fill;
1407 else if (rValue == u"start")
1408 eRet = VclAlign::Start;
1409 else if (rValue == u"end")
1410 eRet = VclAlign::End;
1411 else if (rValue == u"center")
1412 eRet = VclAlign::Center;
1413 return eRet;
1414 }
1415}
1416
1417bool Window::set_font_attribute(const OString &rKey, std::u16string_view rValue)
1418{
1419 if (rKey == "weight")
1420 {
1421 vcl::Font aFont(GetControlFont());
1422 if (rValue == u"thin")
1423 aFont.SetWeight(WEIGHT_THIN);
1424 else if (rValue == u"ultralight")
1426 else if (rValue == u"light")
1427 aFont.SetWeight(WEIGHT_LIGHT);
1428 else if (rValue == u"book")
1430 else if (rValue == u"normal")
1431 aFont.SetWeight(WEIGHT_NORMAL);
1432 else if (rValue == u"medium")
1433 aFont.SetWeight(WEIGHT_MEDIUM);
1434 else if (rValue == u"semibold")
1436 else if (rValue == u"bold")
1437 aFont.SetWeight(WEIGHT_BOLD);
1438 else if (rValue == u"ultrabold")
1440 else
1441 aFont.SetWeight(WEIGHT_BLACK);
1442 SetControlFont(aFont);
1443 }
1444 else if (rKey == "style")
1445 {
1446 vcl::Font aFont(GetControlFont());
1447 if (rValue == u"normal")
1448 aFont.SetItalic(ITALIC_NONE);
1449 else if (rValue == u"oblique")
1451 else if (rValue == u"italic")
1452 aFont.SetItalic(ITALIC_NORMAL);
1453 SetControlFont(aFont);
1454 }
1455 else if (rKey == "underline")
1456 {
1457 vcl::Font aFont(GetControlFont());
1459 SetControlFont(aFont);
1460 }
1461 else if (rKey == "scale")
1462 {
1463 // if no control font was set yet, take the underlying font from the device
1465 aFont.SetFontHeight(aFont.GetFontHeight() * o3tl::toDouble(rValue));
1466 SetControlFont(aFont);
1467 }
1468 else if (rKey == "size")
1469 {
1470 vcl::Font aFont(GetControlFont());
1471 sal_Int32 nHeight = o3tl::toInt32(rValue) / 1000;
1472 aFont.SetFontHeight(nHeight);
1473 SetControlFont(aFont);
1474 }
1475 else
1476 {
1477 SAL_INFO("vcl.layout", "unhandled font attribute: " << rKey);
1478 return false;
1479 }
1480 return true;
1481}
1482
1483bool Window::set_property(const OString &rKey, const OUString &rValue)
1484{
1485 if ((rKey == "label") || (rKey == "title") || (rKey == "text") )
1486 {
1488 }
1489 else if (rKey == "visible")
1490 Show(toBool(rValue));
1491 else if (rKey == "sensitive")
1492 Enable(toBool(rValue));
1493 else if (rKey == "resizable")
1494 {
1495 WinBits nBits = GetStyle();
1496 nBits &= ~WB_SIZEABLE;
1497 if (toBool(rValue))
1498 nBits |= WB_SIZEABLE;
1499 SetStyle(nBits);
1500 }
1501 else if (rKey == "xalign")
1502 {
1503 WinBits nBits = GetStyle();
1504 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1505
1506 float f = rValue.toFloat();
1507 assert(f == 0.0 || f == 1.0 || f == 0.5);
1508 if (f == 0.0)
1509 nBits |= WB_LEFT;
1510 else if (f == 1.0)
1511 nBits |= WB_RIGHT;
1512 else if (f == 0.5)
1513 nBits |= WB_CENTER;
1514
1515 SetStyle(nBits);
1516 }
1517 else if (rKey == "justification")
1518 {
1519 WinBits nBits = GetStyle();
1520 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1521
1522 if (rValue == "left")
1523 nBits |= WB_LEFT;
1524 else if (rValue == "right")
1525 nBits |= WB_RIGHT;
1526 else if (rValue == "center")
1527 nBits |= WB_CENTER;
1528
1529 SetStyle(nBits);
1530 }
1531 else if (rKey == "yalign")
1532 {
1533 WinBits nBits = GetStyle();
1534 nBits &= ~(WB_TOP | WB_VCENTER | WB_BOTTOM);
1535
1536 float f = rValue.toFloat();
1537 assert(f == 0.0 || f == 1.0 || f == 0.5);
1538 if (f == 0.0)
1539 nBits |= WB_TOP;
1540 else if (f == 1.0)
1541 nBits |= WB_BOTTOM;
1542 else if (f == 0.5)
1543 nBits |= WB_VCENTER;
1544
1545 SetStyle(nBits);
1546 }
1547 else if (rKey == "wrap")
1548 {
1549 WinBits nBits = GetStyle();
1550 nBits &= ~WB_WORDBREAK;
1551 if (toBool(rValue))
1552 nBits |= WB_WORDBREAK;
1553 SetStyle(nBits);
1554 }
1555 else if (rKey == "height-request")
1556 set_height_request(rValue.toInt32());
1557 else if (rKey == "width-request")
1558 set_width_request(rValue.toInt32());
1559 else if (rKey == "hexpand")
1560 set_hexpand(toBool(rValue));
1561 else if (rKey == "vexpand")
1562 set_vexpand(toBool(rValue));
1563 else if (rKey == "halign")
1564 set_halign(toAlign(rValue));
1565 else if (rKey == "valign")
1566 set_valign(toAlign(rValue));
1567 else if (rKey == "tooltip-markup")
1568 SetQuickHelpText(rValue);
1569 else if (rKey == "tooltip-text")
1570 SetQuickHelpText(rValue);
1571 else if (rKey == "border-width")
1572 set_border_width(rValue.toInt32());
1573 else if (rKey == "margin-start" || rKey == "margin-left")
1574 {
1575 assert(rKey == "margin-start" && "margin-left deprecated in favor of margin-start");
1576 set_margin_start(rValue.toInt32());
1577 }
1578 else if (rKey == "margin-end" || rKey == "margin-right")
1579 {
1580 assert(rKey == "margin-end" && "margin-right deprecated in favor of margin-end");
1581 set_margin_end(rValue.toInt32());
1582 }
1583 else if (rKey == "margin-top")
1584 set_margin_top(rValue.toInt32());
1585 else if (rKey == "margin-bottom")
1586 set_margin_bottom(rValue.toInt32());
1587 else if (rKey == "hscrollbar-policy")
1588 {
1589 WinBits nBits = GetStyle();
1590 nBits &= ~(WB_AUTOHSCROLL|WB_HSCROLL);
1591 if (rValue == "always")
1592 nBits |= WB_HSCROLL;
1593 else if (rValue == "automatic")
1594 nBits |= WB_AUTOHSCROLL;
1595 SetStyle(nBits);
1596 }
1597 else if (rKey == "vscrollbar-policy")
1598 {
1599 WinBits nBits = GetStyle();
1600 nBits &= ~(WB_AUTOVSCROLL|WB_VSCROLL);
1601 if (rValue == "always")
1602 nBits |= WB_VSCROLL;
1603 else if (rValue == "automatic")
1604 nBits |= WB_AUTOVSCROLL;
1605 SetStyle(nBits);
1606 }
1607 else if (rKey == "accessible-name")
1608 {
1609 SetAccessibleName(rValue);
1610 }
1611 else if (rKey == "accessible-description")
1612 {
1614 }
1615 else if (rKey == "accessible-role")
1616 {
1617 sal_Int16 role = BuilderUtils::getRoleFromName(rValue.toUtf8());
1618 if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
1619 SetAccessibleRole(role);
1620 }
1621 else if (rKey == "use-markup")
1622 {
1623 //https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
1624 SAL_WARN_IF(toBool(rValue), "vcl.layout", "Use pango attributes instead of mark-up");
1625 }
1626 else if (rKey == "has-focus")
1627 {
1628 if (toBool(rValue))
1629 GrabFocus();
1630 }
1631 else if (rKey == "can-focus")
1632 {
1633 WinBits nBits = GetStyle();
1634 nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
1635 if (toBool(rValue))
1636 nBits |= WB_TABSTOP;
1637 else
1638 nBits |= WB_NOTABSTOP;
1639 SetStyle(nBits);
1640 }
1641 else
1642 {
1643 SAL_INFO("vcl.layout", "unhandled property: " << rKey);
1644 return false;
1645 }
1646 return true;
1647}
1648
1649void Window::set_height_request(sal_Int32 nHeightRequest)
1650{
1651 if (!mpWindowImpl)
1652 return;
1653
1654 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1655
1656 if ( pWindowImpl->mnHeightRequest != nHeightRequest )
1657 {
1658 pWindowImpl->mnHeightRequest = nHeightRequest;
1659 queue_resize();
1660 }
1661}
1662
1663void Window::set_width_request(sal_Int32 nWidthRequest)
1664{
1665 if (!mpWindowImpl)
1666 return;
1667
1668 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1669
1670 if ( pWindowImpl->mnWidthRequest != nWidthRequest )
1671 {
1672 pWindowImpl->mnWidthRequest = nWidthRequest;
1673 queue_resize();
1674 }
1675}
1676
1678{
1680 if (aRet.Width() == -1 || aRet.Height() == -1)
1681 {
1682 //cache gets blown away by queue_resize
1683 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1684 if (pWindowImpl->mnOptimalWidthCache == -1 || pWindowImpl->mnOptimalHeightCache == -1)
1685 {
1686 Size aOptimal(GetOptimalSize());
1687 pWindowImpl->mnOptimalWidthCache = aOptimal.Width();
1688 pWindowImpl->mnOptimalHeightCache = aOptimal.Height();
1689 }
1690
1691 if (aRet.Width() == -1)
1692 aRet.setWidth( pWindowImpl->mnOptimalWidthCache );
1693 if (aRet.Height() == -1)
1694 aRet.setHeight( pWindowImpl->mnOptimalHeightCache );
1695 }
1696 return aRet;
1697}
1698
1700{
1702
1703 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1704 if (pWindowImpl->m_xSizeGroup)
1705 {
1706 const VclSizeGroupMode eMode = pWindowImpl->m_xSizeGroup->get_mode();
1708 {
1709 const bool bIgnoreInHidden = pWindowImpl->m_xSizeGroup->get_ignore_hidden();
1710 const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1711 for (auto const& window : rWindows)
1712 {
1713 const vcl::Window *pOther = window;
1714 if (pOther == this)
1715 continue;
1716 if (bIgnoreInHidden && !pOther->IsVisible())
1717 continue;
1718 Size aOtherSize = pOther->get_ungrouped_preferred_size();
1720 aRet.setWidth( std::max(aRet.Width(), aOtherSize.Width()) );
1722 aRet.setHeight( std::max(aRet.Height(), aOtherSize.Height()) );
1723 }
1724 }
1725 }
1726
1727 return aRet;
1728}
1729
1731{
1732 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1733 return pWindowImpl->meHalign;
1734}
1735
1737{
1738 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1739 pWindowImpl->meHalign = eAlign;
1740}
1741
1743{
1744 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1745 return pWindowImpl->meValign;
1746}
1747
1749{
1750 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1751 pWindowImpl->meValign = eAlign;
1752}
1753
1755{
1756 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1757 return pWindowImpl->mbHexpand;
1758}
1759
1760void Window::set_hexpand(bool bExpand)
1761{
1762 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1763 pWindowImpl->mbHexpand = bExpand;
1764}
1765
1767{
1768 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1769 return pWindowImpl->mbVexpand;
1770}
1771
1772void Window::set_vexpand(bool bExpand)
1773{
1774 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1775 pWindowImpl->mbVexpand = bExpand;
1776}
1777
1779{
1780 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1781 return pWindowImpl->mbExpand;
1782}
1783
1784void Window::set_expand(bool bExpand)
1785{
1786 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1787 pWindowImpl->mbExpand = bExpand;
1788}
1789
1791{
1792 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1793 return pWindowImpl->mePackType;
1794}
1795
1797{
1798 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1799 pWindowImpl->mePackType = ePackType;
1800}
1801
1802sal_Int32 Window::get_padding() const
1803{
1804 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1805 return pWindowImpl->mnPadding;
1806}
1807
1808void Window::set_padding(sal_Int32 nPadding)
1809{
1810 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1811 pWindowImpl->mnPadding = nPadding;
1812}
1813
1815{
1816 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1817 return pWindowImpl->mbFill;
1818}
1819
1820void Window::set_fill(bool bFill)
1821{
1822 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1823 pWindowImpl->mbFill = bFill;
1824}
1825
1826sal_Int32 Window::get_grid_width() const
1827{
1828 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1829 return pWindowImpl->mnGridWidth;
1830}
1831
1832void Window::set_grid_width(sal_Int32 nCols)
1833{
1834 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1835 pWindowImpl->mnGridWidth = nCols;
1836}
1837
1839{
1840 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1841 return pWindowImpl->mnGridLeftAttach;
1842}
1843
1844void Window::set_grid_left_attach(sal_Int32 nAttach)
1845{
1846 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1847 pWindowImpl->mnGridLeftAttach = nAttach;
1848}
1849
1851{
1852 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1853 return pWindowImpl->mnGridHeight;
1854}
1855
1856void Window::set_grid_height(sal_Int32 nRows)
1857{
1858 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1859 pWindowImpl->mnGridHeight = nRows;
1860}
1861
1863{
1864 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1865 return pWindowImpl->mnGridTopAttach;
1866}
1867
1868void Window::set_grid_top_attach(sal_Int32 nAttach)
1869{
1870 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1871 pWindowImpl->mnGridTopAttach = nAttach;
1872}
1873
1874void Window::set_border_width(sal_Int32 nBorderWidth)
1875{
1876 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1877 pWindowImpl->mnBorderWidth = nBorderWidth;
1878}
1879
1881{
1882 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1883 return pWindowImpl->mnBorderWidth;
1884}
1885
1886void Window::set_margin_start(sal_Int32 nWidth)
1887{
1888 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1889 if (pWindowImpl->mnMarginLeft != nWidth)
1890 {
1891 pWindowImpl->mnMarginLeft = nWidth;
1892 queue_resize();
1893 }
1894}
1895
1897{
1898 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1899 return pWindowImpl->mnMarginLeft;
1900}
1901
1902void Window::set_margin_end(sal_Int32 nWidth)
1903{
1904 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1905 if (pWindowImpl->mnMarginRight != nWidth)
1906 {
1907 pWindowImpl->mnMarginRight = nWidth;
1908 queue_resize();
1909 }
1910}
1911
1912sal_Int32 Window::get_margin_end() const
1913{
1914 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1915 return pWindowImpl->mnMarginRight;
1916}
1917
1918void Window::set_margin_top(sal_Int32 nWidth)
1919{
1920 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1921 if (pWindowImpl->mnMarginTop != nWidth)
1922 {
1923 pWindowImpl->mnMarginTop = nWidth;
1924 queue_resize();
1925 }
1926}
1927
1928sal_Int32 Window::get_margin_top() const
1929{
1930 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1931 return pWindowImpl->mnMarginTop;
1932}
1933
1934void Window::set_margin_bottom(sal_Int32 nWidth)
1935{
1936 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1937 if (pWindowImpl->mnMarginBottom != nWidth)
1938 {
1939 pWindowImpl->mnMarginBottom = nWidth;
1940 queue_resize();
1941 }
1942}
1943
1945{
1946 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1947 return pWindowImpl->mnMarginBottom;
1948}
1949
1951{
1952 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1953 return pWindowImpl->mnHeightRequest;
1954}
1955
1957{
1958 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1959 return pWindowImpl->mnWidthRequest;
1960}
1961
1963{
1964 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1965 return pWindowImpl->mbSecondary;
1966}
1967
1968void Window::set_secondary(bool bSecondary)
1969{
1970 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1971 pWindowImpl->mbSecondary = bSecondary;
1972}
1973
1975{
1976 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1977 return pWindowImpl->mbNonHomogeneous;
1978}
1979
1980void Window::set_non_homogeneous(bool bNonHomogeneous)
1981{
1982 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1983 pWindowImpl->mbNonHomogeneous = bNonHomogeneous;
1984}
1985
1986void Window::add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup)
1987{
1988 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1989 //To-Do, multiple groups
1990 pWindowImpl->m_xSizeGroup = xGroup;
1991 pWindowImpl->m_xSizeGroup->insert(this);
1992 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
1993 queue_resize();
1994}
1995
1997{
1998 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1999 //To-Do, multiple groups
2000 if (pWindowImpl->m_xSizeGroup)
2001 {
2002 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
2003 queue_resize();
2004 pWindowImpl->m_xSizeGroup->erase(this);
2005 pWindowImpl->m_xSizeGroup.reset();
2006 }
2007}
2008
2010{
2011 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2012 if (std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel)) != v.end())
2013 return;
2014 v.emplace_back(pLabel);
2015 pLabel->set_mnemonic_widget(this);
2016}
2017
2019{
2020 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2021 auto aFind = std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel));
2022 if (aFind == v.end())
2023 return;
2024 v.erase(aFind);
2025 pLabel->set_mnemonic_widget(nullptr);
2026}
2027
2028const std::vector<VclPtr<FixedText> >& Window::list_mnemonic_labels() const
2029{
2030 return mpWindowImpl->m_aMnemonicLabels;
2031}
2032
2033} /* namespace vcl */
2034
2035void InvertFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
2036{
2037 const int nBorder = 1;
2038 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2039 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Bottom()-nBorder+1), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2040 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2041 rRenderContext.Invert(tools::Rectangle(Point(rRect.Right()-nBorder+1, rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2042}
2043
2044/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool toBool(std::string_view rValue)
Definition: builder.cxx:92
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:170
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:347
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:148
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:182
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:892
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:671
void SetBackground()
Definition: background.cxx:27
OutDevType GetOutDevType() const
Definition: outdev.hxx:406
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:312
bool mbFill
Definition: window.h:389
bool mbNonHomogeneous
Definition: window.h:391
bool mbExpand
Definition: window.h:388
VclPackType mePackType
Definition: window.h:308
bool mbVexpand
Definition: window.h:387
sal_Int32 mnGridLeftAttach
Definition: window.h:311
sal_Int32 mnGridHeight
Definition: window.h:310
sal_Int32 mnOptimalWidthCache
Definition: window.h:272
bool mbSecondary
Definition: window.h:390
sal_Int32 mnPadding
Definition: window.h:309
sal_Int32 mnOptimalHeightCache
Definition: window.h:273
sal_Int32 mnWidthRequest
Definition: window.h:270
bool mbHexpand
Definition: window.h:386
sal_Int32 mnMarginLeft
Definition: window.h:315
sal_Int32 mnMarginRight
Definition: window.h:316
sal_Int32 mnHeightRequest
Definition: window.h:271
VclAlign meHalign
Definition: window.h:306
sal_Int32 mnMarginBottom
Definition: window.h:318
sal_Int32 mnGridWidth
Definition: window.h:313
sal_Int32 mnBorderWidth
Definition: window.h:314
sal_Int32 mnMarginTop
Definition: window.h:317
VclAlign meValign
Definition: window.h:307
std::shared_ptr< VclSizeGroup > m_xSizeGroup
Definition: window.h:285
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:909
void SetFontSize(const Size &)
Definition: font/font.cxx:149
void Merge(const Font &rFont)
Definition: font/font.cxx:358
void SetItalic(FontItalic)
Definition: font/font.cxx:248
void SetWeight(FontWeight)
Definition: font/font.cxx:236
void SetFontHeight(tools::Long nHeight)
Definition: font/font.cxx:908
void SetUnderline(FontLineStyle)
Definition: font/font.cxx:266
const Size & GetFontSize() const
Definition: font/font.cxx:907
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:1073
void SetStyle(WinBits nStyle)
Definition: window.cxx:1966
SAL_DLLPRIVATE Point ImplOutputToFrame(const Point &rPos)
Definition: window2.cxx:968
SAL_DLLPRIVATE Point ImplFrameToOutput(const Point &rPos)
Definition: window2.cxx:973
bool IsToolbarFloatingWindow() const
Definition: window2.cxx:1043
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3711
bool IsReallyVisible() const
Definition: window2.cxx:1138
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
vcl::Window * GetParent() const
Definition: window2.cxx:1128
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1168
sal_Int32 get_padding() const
Definition: window2.cxx:1802
SAL_DLLPRIVATE bool ImplIsPushButton() const
Definition: window2.cxx:952
GetFocusFlags GetGetFocusFlags() const
Definition: window2.cxx:1219
tools::Long GetOutOffXPixel() const
Definition: window3.cxx:123
bool IsInputEnabled() const
Definition: window2.cxx:1158
void SetHelpText(const OUString &rHelpText)
Definition: window2.cxx:1251
const InputContext & GetInputContext() const
Definition: window2.cxx:1093
void SetControlForeground()
Definition: window2.cxx:481
bool IsTracking() const
Definition: window2.cxx:340
bool IsControlFont() const
Definition: window2.cxx:1098
WinBits GetPrevStyle() const
Definition: window2.cxx:989
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
Definition: window2.cxx:1189
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
Definition: window2.cxx:639
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:1199
void HideTracking()
Definition: window2.cxx:151
bool IsPaintTransparent() const
Definition: window2.cxx:1068
void set_halign(VclAlign eAlign)
Definition: window2.cxx:1736
WindowType GetType() const
Definition: window2.cxx:1005
SAL_DLLPRIVATE ::std::vector< VclPtr< vcl::Window > > & ImplGetOwnerDrawList()
Definition: window2.cxx:844
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Definition: window2.cxx:553
void set_padding(sal_Int32 nPadding)
Definition: window2.cxx:1808
VCLXWindow * GetWindowPeer() const
Definition: window2.cxx:1283
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1293
virtual void Tracking(const TrackingEvent &rTEvt)
Definition: window.cxx:1936
virtual void Resize()
Definition: window.cxx:1839
static DockingManager * GetDockingManager()
Definition: window2.cxx:829
Size get_preferred_size() const
Definition: window2.cxx:1699
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:957
tools::Long CalcZoom(tools::Long n) const
Definition: window2.cxx:421
void set_border_width(sal_Int32 nBorderWidth)
Definition: window2.cxx:1874
void set_grid_left_attach(sal_Int32 nAttach)
Definition: window2.cxx:1844
Dialog * GetParentDialog() const
Definition: window2.cxx:1013
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:901
void HideFocus()
Definition: window2.cxx:95
void set_height_request(sal_Int32 nHeightRequest)
Definition: window2.cxx:1649
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1358
static VclPtr< vcl::Window > SaveFocus()
Definition: window2.cxx:375
void set_margin_bottom(sal_Int32 nWidth)
Definition: window2.cxx:1934
const Color & GetControlForeground() const
Definition: window2.cxx:1103
void GrabFocus()
Definition: window.cxx:2983
bool IsCompoundControl() const
Definition: window2.cxx:1224
void SetControlBackground()
Definition: window2.cxx:521
bool IsUpdateMode() const
Definition: window2.cxx:1204
bool IsChildTransparentModeEnabled() const
Definition: window2.cxx:1058
VclPackType get_pack_type() const
Definition: window2.cxx:1790
void set_margin_end(sal_Int32 nWidth)
Definition: window2.cxx:1902
void remove_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2018
SAL_DLLPRIVATE bool ImplIsSplitter() const
Definition: window2.cxx:947
sal_Int32 get_margin_end() const
Definition: window2.cxx:1912
void set_hexpand(bool bExpand)
Definition: window2.cxx:1760
vcl::Cursor * GetCursor() const
Definition: window2.cxx:1234
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
Definition: window2.cxx:577
sal_Int32 get_grid_height() const
Definition: window2.cxx:1850
void set_grid_height(sal_Int32 nRows)
Definition: window2.cxx:1856
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2437
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1268
bool set_font_attribute(const OString &rKey, std::u16string_view rValue)
Definition: window2.cxx:1417
void SetAccessibleDescription(const OUString &rDescr)
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1305
bool IsControlForeground() const
Definition: window2.cxx:1108
WinBits GetStyle() const
Definition: window2.cxx:984
const Fraction & GetZoom() const
Definition: window2.cxx:1241
static void EndSaveFocus(const VclPtr< vcl::Window > &xFocusWin)
Definition: window2.cxx:386
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2191
bool IsDialogControlStart() const
Definition: window2.cxx:1078
bool IsReallyShown() const
Definition: window2.cxx:1143
tools::Long GetOutOffYPixel() const
Definition: window3.cxx:124
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
Definition: window2.cxx:2028
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:854
bool get_vexpand() const
Definition: window2.cxx:1766
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:891
vcl::Font GetControlFont() const
Definition: window2.cxx:462
vcl::Font GetPointFont(vcl::RenderContext const &rRenderContext) const
Definition: window.cxx:2184
bool IsDialog() const
Definition: window2.cxx:1033
bool IsZoom() const
Definition: window2.cxx:1246
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
Definition: window2.cxx:906
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set.
Definition: window.cxx:3265
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void set_pack_type(VclPackType ePackType)
Definition: window2.cxx:1796
bool IsInInitShow() const
Definition: window2.cxx:1148
Size get_ungrouped_preferred_size() const
Definition: window2.cxx:1677
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2670
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
void SetAccessibleName(const OUString &rName)
sal_Int32 get_margin_top() const
Definition: window2.cxx:1928
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:1814
bool get_secondary() const
Definition: window2.cxx:1962
SAL_DLLPRIVATE vcl::Window * ImplGetTopmostFrameWindow()
Definition: stacking.cxx:50
bool IsAlwaysOnTopEnabled() const
Definition: window2.cxx:1174
void SetAccessibleRole(sal_uInt16 nRole)
SAL_DLLPRIVATE ImplWinData * ImplGetWinData() const
Definition: window.cxx:1227
bool IsDockingWindow() const
Definition: window2.cxx:937
sal_Int32 get_margin_start() const
Definition: window2.cxx:1896
void SetZoom(const Fraction &rZoom)
Definition: window2.cxx:394
void SetHelpId(const OString &)
Definition: window2.cxx:849
void SetParentUpdateMode(bool bUpdate)
Definition: window2.cxx:1209
void set_margin_top(sal_Int32 nWidth)
Definition: window2.cxx:1918
sal_Int32 get_height_request() const
Definition: window2.cxx:1950
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
Definition: window2.cxx:1986
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:874
bool IsWait() const
Definition: window2.cxx:1229
void ReleaseMouse()
Definition: mouse.cxx:469
sal_Int32 get_grid_left_attach() const
Definition: window2.cxx:1838
sal_Int32 get_grid_top_attach() const
Definition: window2.cxx:1862
virtual void ShowFocus(const tools::Rectangle &rRect)
Definition: window2.cxx:53
void set_width_request(sal_Int32 nWidthRequest)
Definition: window2.cxx:1663
bool IsSystemWindow() const
Definition: window2.cxx:1028
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
sal_Int32 get_border_width() const
Definition: window2.cxx:1880
virtual Size GetSizePixel() const
Definition: window.cxx:2406
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1118
virtual bool set_property(const OString &rKey, const OUString &rValue)
Definition: window2.cxx:1483
DialogControlFlags GetDialogControlFlags() const
Definition: window2.cxx:1088
const Color & GetControlBackground() const
Definition: window2.cxx:1113
void remove_from_all_size_groups()
Definition: window2.cxx:1996
static SAL_DLLPRIVATE void ImplHandleScroll(Scrollable *pHScrl, double nX, Scrollable *pVScrl, double nY)
Definition: window2.cxx:822
SAL_DLLPRIVATE ImplFrameData * ImplGetFrameData()
Definition: window2.cxx:869
void EnableAllResize()
Definition: window2.cxx:1048
void SetCreatedWithToolkit(bool b)
Definition: window2.cxx:1273
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2177
sal_Int32 get_width_request() const
Definition: window2.cxx:1956
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:942
void set_secondary(bool bSecondary)
Definition: window2.cxx:1968
void StartAutoScroll(StartAutoScrollFlags nFlags)
Definition: window2.cxx:347
void set_margin_start(sal_Int32 nWidth)
Definition: window2.cxx:1886
VclAlign get_halign() const
Definition: window2.cxx:1730
sal_Int32 get_margin_bottom() const
Definition: window2.cxx:1944
bool get_expand() const
Definition: window2.cxx:1778
void set_expand(bool bExpand)
Definition: window2.cxx:1784
bool IsVisible() const
Definition: window2.cxx:1133
void EnableDocking(bool bEnable=true)
Definition: window2.cxx:834
bool get_non_homogeneous() const
Definition: window2.cxx:1974
void CaptureMouse()
Definition: mouse.cxx:451
bool IsDefaultPos() const
Definition: window2.cxx:1179
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1288
weld::Window * GetFrameWeld() const
Definition: window2.cxx:879
void set_grid_top_attach(sal_Int32 nAttach)
Definition: window2.cxx:1868
void SetQuickHelpText(const OUString &rHelpText)
Definition: window2.cxx:1257
void set_valign(VclAlign eAlign)
Definition: window2.cxx:1748
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3033
void set_fill(bool bFill)
Definition: window2.cxx:1820
vcl::Window * GetFrameWindow() const
Definition: window2.cxx:885
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:2009
WindowExtendedStyle GetExtendedStyle() const
Definition: window2.cxx:994
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:861
void set_non_homogeneous(bool bNonHomogeneous)
Definition: window2.cxx:1980
bool IsDefaultSize() const
Definition: window2.cxx:1184
void SetType(WindowType nType)
Definition: window2.cxx:999
void SetDialogControlFlags(DialogControlFlags nFlags)
Definition: window2.cxx:1083
void set_vexpand(bool bExpand)
Definition: window2.cxx:1772
bool IsMenuFloatingWindow() const
Definition: window2.cxx:1038
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Definition: window2.cxx:513
void set_grid_width(sal_Int32 nCols)
Definition: window2.cxx:1832
const OUString & GetQuickHelpText() const
Definition: window2.cxx:1263
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1299
VclAlign get_valign() const
Definition: window2.cxx:1742
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
Definition: window2.cxx:896
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:932
void SetUseFrameData(bool bUseFrameData)
Definition: window2.cxx:246
PointerStyle GetPointer() const
Definition: window2.cxx:1278
SAL_DLLPRIVATE SalGraphics * ImplGetFrameGraphics() const
Definition: window.cxx:1290
bool IsActive() const
Definition: window2.cxx:1214
bool IsEnabled() const
Definition: window2.cxx:1153
sal_Int32 get_grid_width() const
Definition: window2.cxx:1826
bool IsAlwaysEnableInput() const
returns the current AlwaysEnableInput state
Definition: window2.cxx:1163
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1053
bool IsInPaint() const
Definition: window2.cxx:1123
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:978
void EndAutoScroll()
Definition: window2.cxx:362
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:962
void EnablePaint(bool bEnable)
Definition: window2.cxx:1194
void InvalidateSizeCache()
clear OptimalSize cache
Definition: window2.cxx:1338
bool IsMouseTransparent() const
Definition: window2.cxx:1063
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3899
bool get_hexpand() const
Definition: window2.cxx:1754
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:2341
OUString convertMnemonicMarkup(std::u16string_view rIn)
Definition: builder.cxx:2260
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 double lcl_HandleScrollHelper(Scrollable *pScrl, double nN, bool isMultiplyByLineSize)
Definition: window2.cxx:602
static bool HasParentDockingWindow(const vcl::Window *pWindow)
Definition: window2.cxx:1345
HashMap_OWString_Interface aMap
SwNodeOffset abs(const SwNodeOffset &a)
@ OUTDEV_WINDOW
Definition: outdev.hxx:145
PointerStyle
Definition: ptrstyle.hxx:26
QPRO_FUNC_TYPE nType
VclPtr< ImplWheelWindow > mpWheelWindow
Definition: svdata.hxx:152
ImplSVWinData * mpWinData
Definition: svdata.hxx:404
ImplSVAppData maAppData
Definition: svdata.hxx:401
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:2035
@ 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