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