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( ScreenToOutputPixel( 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( ScreenToOutputPixel( 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
973void Window::SetCompoundControl( bool bCompound )
974{
975 if (mpWindowImpl)
976 mpWindowImpl->mbCompoundControl = bCompound;
977}
978
980{
981 return mpWindowImpl ? mpWindowImpl->mnStyle : 0;
982}
983
985{
986 return mpWindowImpl ? mpWindowImpl->mnPrevStyle : 0;
987}
988
990{
991 return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : WindowExtendedStyle::NONE;
992}
993
995{
996 if (mpWindowImpl)
997 mpWindowImpl->mnType = nType;
998}
999
1001{
1002 if (mpWindowImpl)
1003 return mpWindowImpl->mnType;
1004 else
1005 return WindowType::NONE;
1006}
1007
1009{
1010 const vcl::Window *pWindow = this;
1011
1012 while( pWindow )
1013 {
1014 if( pWindow->IsDialog() )
1015 break;
1016
1017 pWindow = pWindow->GetParent();
1018 }
1019
1020 return const_cast<Dialog *>(dynamic_cast<const Dialog*>(pWindow));
1021}
1022
1024{
1025 return mpWindowImpl && mpWindowImpl->mbSysWin;
1026}
1027
1029{
1030 return mpWindowImpl && mpWindowImpl->mbDialog;
1031}
1032
1034{
1035 return mpWindowImpl && mpWindowImpl->mbMenuFloatingWindow;
1036}
1037
1039{
1040 return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow;
1041}
1042
1044{
1045 mpWindowImpl->mbAllResize = true;
1046}
1047
1049{
1050 mpWindowImpl->mbChildTransparent = bEnable;
1051}
1052
1054{
1055 return mpWindowImpl && mpWindowImpl->mbChildTransparent;
1056}
1057
1059{
1060 return mpWindowImpl && mpWindowImpl->mbMouseTransparent;
1061}
1062
1064{
1065 return mpWindowImpl && mpWindowImpl->mbPaintTransparent;
1066}
1067
1069{
1070 mpWindowImpl->mbDlgCtrlStart = bStart;
1071}
1072
1074{
1075 return mpWindowImpl && mpWindowImpl->mbDlgCtrlStart;
1076}
1077
1079{
1080 mpWindowImpl->mnDlgCtrlFlags = nFlags;
1081}
1082
1084{
1085 return mpWindowImpl->mnDlgCtrlFlags;
1086}
1087
1089{
1090 return mpWindowImpl->maInputContext;
1091}
1092
1094{
1095 return bool(mpWindowImpl->mpControlFont);
1096}
1097
1099{
1100 return mpWindowImpl->maControlForeground;
1101}
1102
1104{
1105 return mpWindowImpl->mbControlForeground;
1106}
1107
1109{
1110 return mpWindowImpl->maControlBackground;
1111}
1112
1114{
1115 return mpWindowImpl->mbControlBackground;
1116}
1117
1119{
1120 return mpWindowImpl && mpWindowImpl->mbInPaint;
1121}
1122
1124{
1125 return mpWindowImpl ? mpWindowImpl->mpRealParent.get() : nullptr;
1126}
1127
1129{
1130 return mpWindowImpl && mpWindowImpl->mbVisible;
1131}
1132
1134{
1135 return mpWindowImpl && mpWindowImpl->mbReallyVisible;
1136}
1137
1139{
1140 return mpWindowImpl && mpWindowImpl->mbReallyShown;
1141}
1142
1144{
1145 return mpWindowImpl->mbInInitShow;
1146}
1147
1149{
1150 return mpWindowImpl && !mpWindowImpl->mbDisabled;
1151}
1152
1154{
1155 return mpWindowImpl && !mpWindowImpl->mbInputDisabled;
1156}
1157
1159{
1160 return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
1161}
1162
1164{
1165 return mpWindowImpl->mnActivateMode;
1166
1167}
1168
1170{
1171 return mpWindowImpl->mbAlwaysOnTop;
1172}
1173
1175{
1176 return mpWindowImpl->mbDefPos;
1177}
1178
1180{
1181 return mpWindowImpl->mbDefSize;
1182}
1183
1185{
1186 return Point(GetOutOffXPixel() - rWindow.GetOutOffXPixel(), GetOutOffYPixel() - rWindow.GetOutOffYPixel());
1187}
1188
1189void Window::EnablePaint( bool bEnable )
1190{
1191 mpWindowImpl->mbPaintDisabled = !bEnable;
1192}
1193
1195{
1196 return !mpWindowImpl->mbPaintDisabled;
1197}
1198
1200{
1201 return !mpWindowImpl->mbNoUpdate;
1202}
1203
1205{
1206 mpWindowImpl->mbNoParentUpdate = !bUpdate;
1207}
1208
1210{
1211 return mpWindowImpl->mbActive;
1212}
1213
1215{
1216 return mpWindowImpl->mnGetFocusFlags;
1217}
1218
1220{
1221 return mpWindowImpl && mpWindowImpl->mbCompoundControl;
1222}
1223
1224bool Window::IsWait() const
1225{
1226 return (mpWindowImpl->mnWaitCount != 0);
1227}
1228
1230{
1231 if (!mpWindowImpl)
1232 return nullptr;
1233 return mpWindowImpl->mpCursor;
1234}
1235
1237{
1238 return mpWindowImpl->maZoom;
1239}
1240
1241bool Window::IsZoom() const
1242{
1243 return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
1244}
1245
1246void Window::SetHelpText( const OUString& rHelpText )
1247{
1248 mpWindowImpl->maHelpText = rHelpText;
1249 mpWindowImpl->mbHelpTextDynamic = true;
1250}
1251
1252void Window::SetQuickHelpText( const OUString& rHelpText )
1253{
1254 if (mpWindowImpl)
1255 mpWindowImpl->maQuickHelpText = rHelpText;
1256}
1257
1258const OUString& Window::GetQuickHelpText() const
1259{
1260 return mpWindowImpl->maQuickHelpText;
1261}
1262
1264{
1265 return mpWindowImpl->mbCreatedWithToolkit;
1266}
1267
1269{
1270 mpWindowImpl->mbCreatedWithToolkit = b;
1271}
1272
1274{
1275 return mpWindowImpl->maPointer;
1276}
1277
1279{
1280 return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : nullptr;
1281}
1282
1283void Window::SetPosPixel( const Point& rNewPos )
1284{
1285 setPosSizePixel( rNewPos.X(), rNewPos.Y(), 0, 0, PosSizeFlags::Pos );
1286}
1287
1288void Window::SetSizePixel( const Size& rNewSize )
1289{
1290 setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(),
1292}
1293
1294void Window::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
1295{
1296 setPosSizePixel( rNewPos.X(), rNewPos.Y(),
1297 rNewSize.Width(), rNewSize.Height());
1298}
1299
1300void Window::SetOutputSizePixel( const Size& rNewSize )
1301{
1302 SetSizePixel( Size( rNewSize.Width()+mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder,
1303 rNewSize.Height()+mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder ) );
1304}
1305
1306//When a widget wants to renegotiate layout, get toplevel parent dialog and call
1307//resize on it. Mark all intermediate containers (or container-alike) widgets
1308//as dirty for the size remains unchanged, but layout changed circumstances
1309namespace
1310{
1311 bool queue_ungrouped_resize(vcl::Window const *pOrigWindow)
1312 {
1313 bool bSomeoneCares = false;
1314
1315 vcl::Window *pWindow = pOrigWindow->GetParent();
1316 if (pWindow)
1317 {
1318 if (isContainerWindow(*pWindow))
1319 {
1320 bSomeoneCares = true;
1321 }
1322 else if (pWindow->GetType() == WindowType::TABCONTROL)
1323 {
1324 bSomeoneCares = true;
1325 }
1326 pWindow->queue_resize();
1327 }
1328
1329 return bSomeoneCares;
1330 }
1331}
1332
1334{
1335 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1336 pWindowImpl->mnOptimalWidthCache = -1;
1337 pWindowImpl->mnOptimalHeightCache = -1;
1338}
1339
1340static bool HasParentDockingWindow(const vcl::Window* pWindow)
1341{
1342 while( pWindow )
1343 {
1344 if( pWindow->IsDockingWindow() )
1345 return true;
1346
1347 pWindow = pWindow->GetParent();
1348 }
1349
1350 return false;
1351}
1352
1354{
1355 if (isDisposed())
1356 return;
1357
1358 bool bSomeoneCares = queue_ungrouped_resize(this);
1359
1360 if (eReason != StateChangedType::Visible)
1361 {
1363 }
1364
1365 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1366 if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VclSizeGroupMode::NONE)
1367 {
1368 std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1369 for (VclPtr<vcl::Window> const & pOther : rWindows)
1370 {
1371 if (pOther == this)
1372 continue;
1373 queue_ungrouped_resize(pOther);
1374 }
1375 }
1376
1377 if (bSomeoneCares && !isDisposed())
1378 {
1379 //fdo#57090 force a resync of the borders of the borderwindow onto this
1380 //window in case they have changed
1381 vcl::Window* pBorderWindow = ImplGetBorderWindow();
1382 if (pBorderWindow)
1383 pBorderWindow->Resize();
1384 }
1386 {
1387 Size aSize = GetSizePixel();
1388 if (!aSize.IsEmpty() && !pParent->IsInInitShow()
1390 LogicInvalidate(nullptr);
1391 }
1392}
1393
1394namespace
1395{
1396 VclAlign toAlign(std::u16string_view rValue)
1397 {
1398 VclAlign eRet = VclAlign::Fill;
1399
1400 if (rValue == u"fill")
1401 eRet = VclAlign::Fill;
1402 else if (rValue == u"start")
1403 eRet = VclAlign::Start;
1404 else if (rValue == u"end")
1405 eRet = VclAlign::End;
1406 else if (rValue == u"center")
1407 eRet = VclAlign::Center;
1408 return eRet;
1409 }
1410}
1411
1412bool Window::set_font_attribute(const OUString &rKey, std::u16string_view rValue)
1413{
1414 if (rKey == "weight")
1415 {
1416 vcl::Font aFont(GetControlFont());
1417 if (rValue == u"thin")
1418 aFont.SetWeight(WEIGHT_THIN);
1419 else if (rValue == u"ultralight")
1421 else if (rValue == u"light")
1422 aFont.SetWeight(WEIGHT_LIGHT);
1423 else if (rValue == u"book")
1425 else if (rValue == u"normal")
1426 aFont.SetWeight(WEIGHT_NORMAL);
1427 else if (rValue == u"medium")
1428 aFont.SetWeight(WEIGHT_MEDIUM);
1429 else if (rValue == u"semibold")
1431 else if (rValue == u"bold")
1432 aFont.SetWeight(WEIGHT_BOLD);
1433 else if (rValue == u"ultrabold")
1435 else
1436 aFont.SetWeight(WEIGHT_BLACK);
1437 SetControlFont(aFont);
1438 }
1439 else if (rKey == "style")
1440 {
1441 vcl::Font aFont(GetControlFont());
1442 if (rValue == u"normal")
1443 aFont.SetItalic(ITALIC_NONE);
1444 else if (rValue == u"oblique")
1446 else if (rValue == u"italic")
1447 aFont.SetItalic(ITALIC_NORMAL);
1448 SetControlFont(aFont);
1449 }
1450 else if (rKey == "underline")
1451 {
1452 vcl::Font aFont(GetControlFont());
1454 SetControlFont(aFont);
1455 }
1456 else if (rKey == "scale")
1457 {
1458 // if no control font was set yet, take the underlying font from the device
1460 aFont.SetFontHeight(aFont.GetFontHeight() * o3tl::toDouble(rValue));
1461 SetControlFont(aFont);
1462 }
1463 else if (rKey == "size")
1464 {
1465 vcl::Font aFont(GetControlFont());
1466 sal_Int32 nHeight = o3tl::toInt32(rValue) / 1000;
1467 aFont.SetFontHeight(nHeight);
1468 SetControlFont(aFont);
1469 }
1470 else
1471 {
1472 SAL_INFO("vcl.layout", "unhandled font attribute: " << rKey);
1473 return false;
1474 }
1475 return true;
1476}
1477
1478bool Window::set_property(const OUString &rKey, const OUString &rValue)
1479{
1480 if ((rKey == "label") || (rKey == "title") || (rKey == "text") )
1481 {
1483 }
1484 else if (rKey == "visible")
1485 Show(toBool(rValue));
1486 else if (rKey == "sensitive")
1487 Enable(toBool(rValue));
1488 else if (rKey == "resizable")
1489 {
1490 WinBits nBits = GetStyle();
1491 nBits &= ~WB_SIZEABLE;
1492 if (toBool(rValue))
1493 nBits |= WB_SIZEABLE;
1494 SetStyle(nBits);
1495 }
1496 else if (rKey == "xalign")
1497 {
1498 WinBits nBits = GetStyle();
1499 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1500
1501 float f = rValue.toFloat();
1502 assert(f == 0.0 || f == 1.0 || f == 0.5);
1503 if (f == 0.0)
1504 nBits |= WB_LEFT;
1505 else if (f == 1.0)
1506 nBits |= WB_RIGHT;
1507 else if (f == 0.5)
1508 nBits |= WB_CENTER;
1509
1510 SetStyle(nBits);
1511 }
1512 else if (rKey == "justification")
1513 {
1514 WinBits nBits = GetStyle();
1515 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
1516
1517 if (rValue == "left")
1518 nBits |= WB_LEFT;
1519 else if (rValue == "right")
1520 nBits |= WB_RIGHT;
1521 else if (rValue == "center")
1522 nBits |= WB_CENTER;
1523
1524 SetStyle(nBits);
1525 }
1526 else if (rKey == "yalign")
1527 {
1528 WinBits nBits = GetStyle();
1529 nBits &= ~(WB_TOP | WB_VCENTER | WB_BOTTOM);
1530
1531 float f = rValue.toFloat();
1532 assert(f == 0.0 || f == 1.0 || f == 0.5);
1533 if (f == 0.0)
1534 nBits |= WB_TOP;
1535 else if (f == 1.0)
1536 nBits |= WB_BOTTOM;
1537 else if (f == 0.5)
1538 nBits |= WB_VCENTER;
1539
1540 SetStyle(nBits);
1541 }
1542 else if (rKey == "wrap")
1543 {
1544 WinBits nBits = GetStyle();
1545 nBits &= ~WB_WORDBREAK;
1546 if (toBool(rValue))
1547 nBits |= WB_WORDBREAK;
1548 SetStyle(nBits);
1549 }
1550 else if (rKey == "height-request")
1551 set_height_request(rValue.toInt32());
1552 else if (rKey == "width-request")
1553 set_width_request(rValue.toInt32());
1554 else if (rKey == "hexpand")
1555 set_hexpand(toBool(rValue));
1556 else if (rKey == "vexpand")
1557 set_vexpand(toBool(rValue));
1558 else if (rKey == "halign")
1559 set_halign(toAlign(rValue));
1560 else if (rKey == "valign")
1561 set_valign(toAlign(rValue));
1562 else if (rKey == "tooltip-markup")
1563 SetQuickHelpText(rValue);
1564 else if (rKey == "tooltip-text")
1565 SetQuickHelpText(rValue);
1566 else if (rKey == "border-width")
1567 set_border_width(rValue.toInt32());
1568 else if (rKey == "margin-start" || rKey == "margin-left")
1569 {
1570 assert(rKey == "margin-start" && "margin-left deprecated in favor of margin-start");
1571 set_margin_start(rValue.toInt32());
1572 }
1573 else if (rKey == "margin-end" || rKey == "margin-right")
1574 {
1575 assert(rKey == "margin-end" && "margin-right deprecated in favor of margin-end");
1576 set_margin_end(rValue.toInt32());
1577 }
1578 else if (rKey == "margin-top")
1579 set_margin_top(rValue.toInt32());
1580 else if (rKey == "margin-bottom")
1581 set_margin_bottom(rValue.toInt32());
1582 else if (rKey == "hscrollbar-policy")
1583 {
1584 WinBits nBits = GetStyle();
1585 nBits &= ~(WB_AUTOHSCROLL|WB_HSCROLL);
1586 if (rValue == "always")
1587 nBits |= WB_HSCROLL;
1588 else if (rValue == "automatic")
1589 nBits |= WB_AUTOHSCROLL;
1590 SetStyle(nBits);
1591 }
1592 else if (rKey == "vscrollbar-policy")
1593 {
1594 WinBits nBits = GetStyle();
1595 nBits &= ~(WB_AUTOVSCROLL|WB_VSCROLL);
1596 if (rValue == "always")
1597 nBits |= WB_VSCROLL;
1598 else if (rValue == "automatic")
1599 nBits |= WB_AUTOVSCROLL;
1600 SetStyle(nBits);
1601 }
1602 else if (rKey == "accessible-name")
1603 {
1604 SetAccessibleName(rValue);
1605 }
1606 else if (rKey == "accessible-description")
1607 {
1609 }
1610 else if (rKey == "accessible-role")
1611 {
1612 sal_Int16 role = BuilderUtils::getRoleFromName(rValue);
1613 if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
1614 SetAccessibleRole(role);
1615 }
1616 else if (rKey == "use-markup")
1617 {
1618 //https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
1619 SAL_WARN_IF(toBool(rValue), "vcl.layout", "Use pango attributes instead of mark-up");
1620 }
1621 else if (rKey == "has-focus")
1622 {
1623 if (toBool(rValue))
1624 GrabFocus();
1625 }
1626 else if (rKey == "can-focus")
1627 {
1628 WinBits nBits = GetStyle();
1629 nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
1630 if (toBool(rValue))
1631 nBits |= WB_TABSTOP;
1632 else
1633 nBits |= WB_NOTABSTOP;
1634 SetStyle(nBits);
1635 }
1636 else
1637 {
1638 SAL_INFO("vcl.layout", "unhandled property: " << rKey);
1639 return false;
1640 }
1641 return true;
1642}
1643
1644void Window::set_height_request(sal_Int32 nHeightRequest)
1645{
1646 if (!mpWindowImpl)
1647 return;
1648
1649 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1650
1651 if ( pWindowImpl->mnHeightRequest != nHeightRequest )
1652 {
1653 pWindowImpl->mnHeightRequest = nHeightRequest;
1654 queue_resize();
1655 }
1656}
1657
1658void Window::set_width_request(sal_Int32 nWidthRequest)
1659{
1660 if (!mpWindowImpl)
1661 return;
1662
1663 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1664
1665 if ( pWindowImpl->mnWidthRequest != nWidthRequest )
1666 {
1667 pWindowImpl->mnWidthRequest = nWidthRequest;
1668 queue_resize();
1669 }
1670}
1671
1673{
1675 if (aRet.Width() == -1 || aRet.Height() == -1)
1676 {
1677 //cache gets blown away by queue_resize
1678 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1679 if (pWindowImpl->mnOptimalWidthCache == -1 || pWindowImpl->mnOptimalHeightCache == -1)
1680 {
1681 Size aOptimal(GetOptimalSize());
1682 pWindowImpl->mnOptimalWidthCache = aOptimal.Width();
1683 pWindowImpl->mnOptimalHeightCache = aOptimal.Height();
1684 }
1685
1686 if (aRet.Width() == -1)
1687 aRet.setWidth( pWindowImpl->mnOptimalWidthCache );
1688 if (aRet.Height() == -1)
1689 aRet.setHeight( pWindowImpl->mnOptimalHeightCache );
1690 }
1691 return aRet;
1692}
1693
1695{
1697
1698 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1699 if (pWindowImpl->m_xSizeGroup)
1700 {
1701 const VclSizeGroupMode eMode = pWindowImpl->m_xSizeGroup->get_mode();
1703 {
1704 const bool bIgnoreInHidden = pWindowImpl->m_xSizeGroup->get_ignore_hidden();
1705 const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
1706 for (auto const& window : rWindows)
1707 {
1708 const vcl::Window *pOther = window;
1709 if (pOther == this)
1710 continue;
1711 if (bIgnoreInHidden && !pOther->IsVisible())
1712 continue;
1713 Size aOtherSize = pOther->get_ungrouped_preferred_size();
1715 aRet.setWidth( std::max(aRet.Width(), aOtherSize.Width()) );
1717 aRet.setHeight( std::max(aRet.Height(), aOtherSize.Height()) );
1718 }
1719 }
1720 }
1721
1722 return aRet;
1723}
1724
1726{
1727 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1728 return pWindowImpl->meHalign;
1729}
1730
1732{
1733 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1734 pWindowImpl->meHalign = eAlign;
1735}
1736
1738{
1739 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1740 return pWindowImpl->meValign;
1741}
1742
1744{
1745 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1746 pWindowImpl->meValign = eAlign;
1747}
1748
1750{
1751 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1752 return pWindowImpl->mbHexpand;
1753}
1754
1755void Window::set_hexpand(bool bExpand)
1756{
1757 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1758 pWindowImpl->mbHexpand = bExpand;
1759}
1760
1762{
1763 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1764 return pWindowImpl->mbVexpand;
1765}
1766
1767void Window::set_vexpand(bool bExpand)
1768{
1769 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1770 pWindowImpl->mbVexpand = bExpand;
1771}
1772
1774{
1775 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1776 return pWindowImpl->mbExpand;
1777}
1778
1779void Window::set_expand(bool bExpand)
1780{
1781 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1782 pWindowImpl->mbExpand = bExpand;
1783}
1784
1786{
1787 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1788 return pWindowImpl->mePackType;
1789}
1790
1792{
1793 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1794 pWindowImpl->mePackType = ePackType;
1795}
1796
1797sal_Int32 Window::get_padding() const
1798{
1799 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1800 return pWindowImpl->mnPadding;
1801}
1802
1803void Window::set_padding(sal_Int32 nPadding)
1804{
1805 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1806 pWindowImpl->mnPadding = nPadding;
1807}
1808
1810{
1811 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1812 return pWindowImpl->mbFill;
1813}
1814
1815void Window::set_fill(bool bFill)
1816{
1817 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1818 pWindowImpl->mbFill = bFill;
1819}
1820
1821sal_Int32 Window::get_grid_width() const
1822{
1823 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1824 return pWindowImpl->mnGridWidth;
1825}
1826
1827void Window::set_grid_width(sal_Int32 nCols)
1828{
1829 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1830 pWindowImpl->mnGridWidth = nCols;
1831}
1832
1834{
1835 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1836 return pWindowImpl->mnGridLeftAttach;
1837}
1838
1839void Window::set_grid_left_attach(sal_Int32 nAttach)
1840{
1841 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1842 pWindowImpl->mnGridLeftAttach = nAttach;
1843}
1844
1846{
1847 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1848 return pWindowImpl->mnGridHeight;
1849}
1850
1851void Window::set_grid_height(sal_Int32 nRows)
1852{
1853 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1854 pWindowImpl->mnGridHeight = nRows;
1855}
1856
1858{
1859 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1860 return pWindowImpl->mnGridTopAttach;
1861}
1862
1863void Window::set_grid_top_attach(sal_Int32 nAttach)
1864{
1865 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1866 pWindowImpl->mnGridTopAttach = nAttach;
1867}
1868
1869void Window::set_border_width(sal_Int32 nBorderWidth)
1870{
1871 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1872 pWindowImpl->mnBorderWidth = nBorderWidth;
1873}
1874
1876{
1877 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1878 return pWindowImpl->mnBorderWidth;
1879}
1880
1881void Window::set_margin_start(sal_Int32 nWidth)
1882{
1883 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1884 if (pWindowImpl->mnMarginLeft != nWidth)
1885 {
1886 pWindowImpl->mnMarginLeft = nWidth;
1887 queue_resize();
1888 }
1889}
1890
1892{
1893 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1894 return pWindowImpl->mnMarginLeft;
1895}
1896
1897void Window::set_margin_end(sal_Int32 nWidth)
1898{
1899 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1900 if (pWindowImpl->mnMarginRight != nWidth)
1901 {
1902 pWindowImpl->mnMarginRight = nWidth;
1903 queue_resize();
1904 }
1905}
1906
1907sal_Int32 Window::get_margin_end() const
1908{
1909 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1910 return pWindowImpl->mnMarginRight;
1911}
1912
1913void Window::set_margin_top(sal_Int32 nWidth)
1914{
1915 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1916 if (pWindowImpl->mnMarginTop != nWidth)
1917 {
1918 pWindowImpl->mnMarginTop = nWidth;
1919 queue_resize();
1920 }
1921}
1922
1923sal_Int32 Window::get_margin_top() const
1924{
1925 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1926 return pWindowImpl->mnMarginTop;
1927}
1928
1929void Window::set_margin_bottom(sal_Int32 nWidth)
1930{
1931 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1932 if (pWindowImpl->mnMarginBottom != nWidth)
1933 {
1934 pWindowImpl->mnMarginBottom = nWidth;
1935 queue_resize();
1936 }
1937}
1938
1940{
1941 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1942 return pWindowImpl->mnMarginBottom;
1943}
1944
1946{
1947 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1948 return pWindowImpl->mnHeightRequest;
1949}
1950
1952{
1953 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1954 return pWindowImpl->mnWidthRequest;
1955}
1956
1958{
1959 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1960 return pWindowImpl->mbSecondary;
1961}
1962
1963void Window::set_secondary(bool bSecondary)
1964{
1965 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1966 pWindowImpl->mbSecondary = bSecondary;
1967}
1968
1970{
1971 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1972 return pWindowImpl->mbNonHomogeneous;
1973}
1974
1975void Window::set_non_homogeneous(bool bNonHomogeneous)
1976{
1977 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1978 pWindowImpl->mbNonHomogeneous = bNonHomogeneous;
1979}
1980
1981void Window::add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup)
1982{
1983 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1984 //To-Do, multiple groups
1985 pWindowImpl->m_xSizeGroup = xGroup;
1986 pWindowImpl->m_xSizeGroup->insert(this);
1987 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
1988 queue_resize();
1989}
1990
1992{
1993 WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
1994 //To-Do, multiple groups
1995 if (pWindowImpl->m_xSizeGroup)
1996 {
1997 if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
1998 queue_resize();
1999 pWindowImpl->m_xSizeGroup->erase(this);
2000 pWindowImpl->m_xSizeGroup.reset();
2001 }
2002}
2003
2005{
2006 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2007 if (std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel)) != v.end())
2008 return;
2009 v.emplace_back(pLabel);
2010 pLabel->set_mnemonic_widget(this);
2011}
2012
2014{
2015 std::vector<VclPtr<FixedText> >& v = mpWindowImpl->m_aMnemonicLabels;
2016 auto aFind = std::find(v.begin(), v.end(), VclPtr<FixedText>(pLabel));
2017 if (aFind == v.end())
2018 return;
2019 v.erase(aFind);
2020 pLabel->set_mnemonic_widget(nullptr);
2021}
2022
2023const std::vector<VclPtr<FixedText> >& Window::list_mnemonic_labels() const
2024{
2025 return mpWindowImpl->m_aMnemonicLabels;
2026}
2027
2028} /* namespace vcl */
2029
2030void InvertFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
2031{
2032 const int nBorder = 1;
2033 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2034 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Bottom()-nBorder+1), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
2035 rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2036 rRenderContext.Invert(tools::Rectangle(Point(rRect.Right()-nBorder+1, rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
2037}
2038
2039/* 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:334
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:879
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)
constexpr tools::Long Y() const
constexpr tools::Long X() const
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:1068
void SetStyle(WinBits nStyle)
Definition: window.cxx:1962
bool IsToolbarFloatingWindow() const
Definition: window2.cxx:1038
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3710
bool IsReallyVisible() const
Definition: window2.cxx:1133
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
vcl::Window * GetParent() const
Definition: window2.cxx:1123
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1163
sal_Int32 get_padding() const
Definition: window2.cxx:1797
SAL_DLLPRIVATE bool ImplIsPushButton() const
Definition: window2.cxx:957
GetFocusFlags GetGetFocusFlags() const
Definition: window2.cxx:1214
tools::Long GetOutOffXPixel() const
Definition: window3.cxx:123
bool IsInputEnabled() const
Definition: window2.cxx:1153
void SetHelpText(const OUString &rHelpText)
Definition: window2.cxx:1246
const InputContext & GetInputContext() const
Definition: window2.cxx:1088
void SetControlForeground()
Definition: window2.cxx:486
bool IsTracking() const
Definition: window2.cxx:337
bool IsControlFont() const
Definition: window2.cxx:1093
WinBits GetPrevStyle() const
Definition: window2.cxx:984
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
Definition: window2.cxx:1184
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:1194
void HideTracking()
Definition: window2.cxx:151
bool IsPaintTransparent() const
Definition: window2.cxx:1063
void set_halign(VclAlign eAlign)
Definition: window2.cxx:1731
WindowType GetType() const
Definition: window2.cxx:1000
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:1803
VCLXWindow * GetWindowPeer() const
Definition: window2.cxx:1278
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1288
virtual void Tracking(const TrackingEvent &rTEvt)
Definition: window.cxx:1932
virtual void Resize()
Definition: window.cxx:1835
static DockingManager * GetDockingManager()
Definition: window2.cxx:834
Size get_preferred_size() const
Definition: window2.cxx:1694
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:1869
void set_grid_left_attach(sal_Int32 nAttach)
Definition: window2.cxx:1839
Dialog * GetParentDialog() const
Definition: window2.cxx:1008
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:1644
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1353
static VclPtr< vcl::Window > SaveFocus()
Definition: window2.cxx:380
void set_margin_bottom(sal_Int32 nWidth)
Definition: window2.cxx:1929
const Color & GetControlForeground() const
Definition: window2.cxx:1098
void GrabFocus()
Definition: window.cxx:2976
bool IsCompoundControl() const
Definition: window2.cxx:1219
void SetControlBackground()
Definition: window2.cxx:526
bool IsUpdateMode() const
Definition: window2.cxx:1199
bool IsChildTransparentModeEnabled() const
Definition: window2.cxx:1053
bool set_font_attribute(const OUString &rKey, std::u16string_view rValue)
Definition: window2.cxx:1412
VclPackType get_pack_type() const
Definition: window2.cxx:1785
void set_margin_end(sal_Int32 nWidth)
Definition: window2.cxx:1897
void remove_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2013
SAL_DLLPRIVATE bool ImplIsSplitter() const
Definition: window2.cxx:952
sal_Int32 get_margin_end() const
Definition: window2.cxx:1907
void set_hexpand(bool bExpand)
Definition: window2.cxx:1755
vcl::Cursor * GetCursor() const
Definition: window2.cxx:1229
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
Definition: window2.cxx:582
sal_Int32 get_grid_height() const
Definition: window2.cxx:1845
void set_grid_height(sal_Int32 nRows)
Definition: window2.cxx:1851
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2433
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1263
void SetAccessibleDescription(const OUString &rDescr)
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1300
bool IsControlForeground() const
Definition: window2.cxx:1103
WinBits GetStyle() const
Definition: window2.cxx:979
const Fraction & GetZoom() const
Definition: window2.cxx:1236
static void EndSaveFocus(const VclPtr< vcl::Window > &xFocusWin)
Definition: window2.cxx:391
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
bool IsDialogControlStart() const
Definition: window2.cxx:1073
bool IsReallyShown() const
Definition: window2.cxx:1138
tools::Long GetOutOffYPixel() const
Definition: window3.cxx:124
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
Definition: window2.cxx:2023
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:1761
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:2180
bool IsDialog() const
Definition: window2.cxx:1028
bool IsZoom() const
Definition: window2.cxx:1241
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:3256
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void set_pack_type(VclPackType ePackType)
Definition: window2.cxx:1791
bool IsInInitShow() const
Definition: window2.cxx:1143
Size get_ungrouped_preferred_size() const
Definition: window2.cxx:1672
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2666
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
void SetAccessibleName(const OUString &rName)
sal_Int32 get_margin_top() const
Definition: window2.cxx:1923
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:1809
bool get_secondary() const
Definition: window2.cxx:1957
SAL_DLLPRIVATE vcl::Window * ImplGetTopmostFrameWindow()
Definition: stacking.cxx:51
bool IsAlwaysOnTopEnabled() const
Definition: window2.cxx:1169
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:1891
void SetZoom(const Fraction &rZoom)
Definition: window2.cxx:399
void SetParentUpdateMode(bool bUpdate)
Definition: window2.cxx:1204
void set_margin_top(sal_Int32 nWidth)
Definition: window2.cxx:1913
sal_Int32 get_height_request() const
Definition: window2.cxx:1945
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
Definition: window2.cxx:1981
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:1224
void ReleaseMouse()
Definition: mouse.cxx:469
sal_Int32 get_grid_left_attach() const
Definition: window2.cxx:1833
sal_Int32 get_grid_top_attach() const
Definition: window2.cxx:1857
virtual void ShowFocus(const tools::Rectangle &rRect)
Definition: window2.cxx:53
void set_width_request(sal_Int32 nWidthRequest)
Definition: window2.cxx:1658
bool IsSystemWindow() const
Definition: window2.cxx:1023
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
sal_Int32 get_border_width() const
Definition: window2.cxx:1875
virtual Size GetSizePixel() const
Definition: window.cxx:2402
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1113
DialogControlFlags GetDialogControlFlags() const
Definition: window2.cxx:1083
const Color & GetControlBackground() const
Definition: window2.cxx:1108
void remove_from_all_size_groups()
Definition: window2.cxx:1991
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:1043
void SetCreatedWithToolkit(bool b)
Definition: window2.cxx:1268
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2173
sal_Int32 get_width_request() const
Definition: window2.cxx:1951
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:947
void set_secondary(bool bSecondary)
Definition: window2.cxx:1963
void StartAutoScroll(StartAutoScrollFlags nFlags)
Definition: window2.cxx:352
void set_margin_start(sal_Int32 nWidth)
Definition: window2.cxx:1881
VclAlign get_halign() const
Definition: window2.cxx:1725
sal_Int32 get_margin_bottom() const
Definition: window2.cxx:1939
bool get_expand() const
Definition: window2.cxx:1773
void set_expand(bool bExpand)
Definition: window2.cxx:1779
bool IsVisible() const
Definition: window2.cxx:1128
void EnableDocking(bool bEnable=true)
Definition: window2.cxx:839
bool get_non_homogeneous() const
Definition: window2.cxx:1969
void CaptureMouse()
Definition: mouse.cxx:451
bool IsDefaultPos() const
Definition: window2.cxx:1174
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1283
weld::Window * GetFrameWeld() const
Definition: window2.cxx:884
void set_grid_top_attach(sal_Int32 nAttach)
Definition: window2.cxx:1863
void SetQuickHelpText(const OUString &rHelpText)
Definition: window2.cxx:1252
void set_valign(VclAlign eAlign)
Definition: window2.cxx:1743
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3026
void set_fill(bool bFill)
Definition: window2.cxx:1815
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:2004
WindowExtendedStyle GetExtendedStyle() const
Definition: window2.cxx:989
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:1975
bool IsDefaultSize() const
Definition: window2.cxx:1179
void SetType(WindowType nType)
Definition: window2.cxx:994
virtual bool set_property(const OUString &rKey, const OUString &rValue)
Definition: window2.cxx:1478
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2812
void SetDialogControlFlags(DialogControlFlags nFlags)
Definition: window2.cxx:1078
void set_vexpand(bool bExpand)
Definition: window2.cxx:1767
bool IsMenuFloatingWindow() const
Definition: window2.cxx:1033
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Definition: window2.cxx:518
void set_grid_width(sal_Int32 nCols)
Definition: window2.cxx:1827
const OUString & GetQuickHelpText() const
Definition: window2.cxx:1258
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1294
VclAlign get_valign() const
Definition: window2.cxx:1737
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:1273
SAL_DLLPRIVATE SalGraphics * ImplGetFrameGraphics() const
Definition: window.cxx:1289
bool IsActive() const
Definition: window2.cxx:1209
bool IsEnabled() const
Definition: window2.cxx:1148
sal_Int32 get_grid_width() const
Definition: window2.cxx:1821
bool IsAlwaysEnableInput() const
returns the current AlwaysEnableInput state
Definition: window2.cxx:1158
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1048
bool IsInPaint() const
Definition: window2.cxx:1118
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:973
void EndAutoScroll()
Definition: window2.cxx:367
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:967
void EnablePaint(bool bEnable)
Definition: window2.cxx:1189
void SetHelpId(const OUString &)
Definition: window2.cxx:854
void InvalidateSizeCache()
clear OptimalSize cache
Definition: window2.cxx:1333
bool IsMouseTransparent() const
Definition: window2.cxx:1058
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3898
bool get_hexpand() const
Definition: window2.cxx:1749
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:1340
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:400
ImplSVAppData maAppData
Definition: svdata.hxx:397
StartAutoScrollFlags mnAutoScrollFlags
Definition: svdata.hxx:265
std::unique_ptr< AutoTimer > mpTrackTimer
Definition: svdata.hxx:258
StartTrackingFlags mnTrackFlags
Definition: svdata.hxx:264
VclPtr< vcl::Window > mpAutoScrollWin
Definition: svdata.hxx:260
VclPtr< vcl::Window > mpFocusWin
Definition: svdata.hxx:251
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:257
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:186
VclPackType
Definition: vclenum.hxx:194
TrackingEventFlags
Definition: vclenum.hxx:358
VclSizeGroupMode
Definition: vclenum.hxx:235
void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: window2.cxx:2030
@ 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