LibreOffice Module vcl (master)  1
window.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 <rtl/strbuf.hxx>
21 #include <sal/log.hxx>
22 
23 #include <sal/types.h>
24 #include <vcl/salgtype.hxx>
25 #include <vcl/event.hxx>
26 #include <vcl/help.hxx>
27 #include <vcl/cursor.hxx>
28 #include <vcl/svapp.hxx>
29 #include <vcl/transfer.hxx>
30 #include <vcl/vclevent.hxx>
31 #include <vcl/window.hxx>
32 #include <vcl/syswin.hxx>
33 #include <vcl/dockwin.hxx>
34 #include <vcl/wall.hxx>
35 #include <vcl/toolkit/fixed.hxx>
36 #include <vcl/taskpanelist.hxx>
37 #include <vcl/toolkit/unowrap.hxx>
38 #include <vcl/lazydelete.hxx>
39 #include <vcl/virdev.hxx>
40 #include <vcl/settings.hxx>
41 #include <vcl/sysdata.hxx>
42 #include <vcl/ptrstyle.hxx>
44 
45 #include <vcl/uitest/uiobject.hxx>
46 
47 #include <salframe.hxx>
48 #include <salobj.hxx>
49 #include <salinst.hxx>
50 #include <salgdi.hxx>
51 #include <svdata.hxx>
52 #include <window.h>
53 #include <toolbox.h>
54 #include <outdev.h>
55 #include <brdwin.hxx>
56 #include <helpwin.hxx>
57 
58 #include <com/sun/star/accessibility/AccessibleRelation.hpp>
59 #include <com/sun/star/accessibility/XAccessible.hpp>
60 #include <com/sun/star/awt/XWindowPeer.hpp>
61 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
62 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
63 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
64 #include <com/sun/star/rendering/CanvasFactory.hpp>
65 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
66 #include <comphelper/lok.hxx>
68 #include <unotools/configmgr.hxx>
69 #include <osl/diagnose.h>
70 #include <tools/debug.hxx>
71 #include <tools/json_writer.hxx>
72 #include <boost/property_tree/ptree.hpp>
73 
74 #include <cassert>
75 #include <typeinfo>
76 
77 #ifdef _WIN32 // see #140456#
78 #include <win/salframe.h>
79 #endif
80 
81 
82 using namespace ::com::sun::star::uno;
83 using namespace ::com::sun::star::lang;
85 using namespace ::com::sun::star::datatransfer::dnd;
86 
87 namespace vcl {
88 
91  , mpWindowImpl(new WindowImpl( nType ))
92 {
93  // true: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
95 }
96 
97 Window::Window( vcl::Window* pParent, WinBits nStyle )
99  , mpWindowImpl(new WindowImpl( WindowType::WINDOW ))
100 {
101  // true: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
103 
104  ImplInit( pParent, nStyle, nullptr );
105 }
106 
107 #if OSL_DEBUG_LEVEL > 0
108 namespace
109 {
110  OString lcl_createWindowInfo(const vcl::Window* pWindow)
111  {
112  // skip border windows, they do not carry information that
113  // would help with diagnosing the problem
114  const vcl::Window* pTempWin( pWindow );
115  while ( pTempWin && pTempWin->GetType() == WindowType::BORDERWINDOW ) {
116  pTempWin = pTempWin->GetWindow( GetWindowType::FirstChild );
117  }
118  // check if pTempWin is not null, otherwise use the
119  // original address
120  if ( pTempWin ) {
121  pWindow = pTempWin;
122  }
123 
124  OStringBuffer aErrorString;
125  aErrorString.append(' ');
126  aErrorString.append(typeid( *pWindow ).name());
127  aErrorString.append("(");
128  aErrorString.append(
130  pWindow->GetText(),
131  RTL_TEXTENCODING_UTF8
132  )
133  );
134  aErrorString.append(")");
135  return aErrorString.makeStringAndClear();
136  }
137 }
138 #endif
139 
140 bool Window::IsDisposed() const
141 {
142  return !mpWindowImpl;
143 }
144 
146 {
147  assert( mpWindowImpl );
148  assert( !mpWindowImpl->mbInDispose ); // should only be called from disposeOnce()
149  assert( (!mpWindowImpl->mpParent ||
150  !mpWindowImpl->mpParent->IsDisposed()) &&
151  "vcl::Window child should have its parent disposed first" );
152 
153  // remove Key and Mouse events issued by Application::PostKey/MouseEvent
155 
156  // Dispose of the canvas implementation (which, currently, has an
157  // own wrapper window as a child to this one.
158  Reference< css::rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
159  if( xCanvas.is() )
160  {
161  Reference < XComponent > xCanvasComponent( xCanvas, UNO_QUERY );
162  if( xCanvasComponent.is() )
163  xCanvasComponent->dispose();
164  }
165 
166  mpWindowImpl->mbInDispose = true;
167 
169 
170  // do not send child events for frames that were registered as native frames
171  if( !ImplIsAccessibleNativeFrame() && mpWindowImpl->mbReallyVisible )
174 
175  // remove associated data structures from dockingmanager
177 
178  // remove ownerdraw decorated windows from list in the top-most frame window
179  if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame )
180  {
181  ::std::vector< VclPtr<vcl::Window> >& rList = ImplGetOwnerDrawList();
182  auto p = ::std::find( rList.begin(), rList.end(), VclPtr<vcl::Window>(this) );
183  if( p != rList.end() )
184  rList.erase( p );
185  }
186 
187  // shutdown drag and drop
188  Reference < XComponent > xDnDComponent( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
189 
190  if( xDnDComponent.is() )
191  xDnDComponent->dispose();
192 
193  if( mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData )
194  {
195  try
196  {
197  // deregister drop target listener
198  if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
199  {
200  Reference< XDragGestureRecognizer > xDragGestureRecognizer(mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
201  if( xDragGestureRecognizer.is() )
202  {
203  xDragGestureRecognizer->removeDragGestureListener(
204  Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
205  }
206 
207  mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
208  mpWindowImpl->mpFrameData->mxDropTargetListener.clear();
209  }
210 
211  // shutdown drag and drop for this frame window
212  Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
213 
214  // DNDEventDispatcher does not hold a reference of the DropTarget,
215  // so it's ok if it does not support XComponent
216  if( xComponent.is() )
217  xComponent->dispose();
218  }
219  catch (const Exception&)
220  {
221  // can be safely ignored here.
222  }
223  }
224 
225  UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper( false );
226  if ( pWrapper )
227  pWrapper->WindowDestroyed( this );
228 
229  // MT: Must be called after WindowDestroyed!
230  // Otherwise, if the accessible is a VCLXWindow, it will try to destroy this window again!
231  // But accessibility implementations from applications need this dispose.
232  if ( mpWindowImpl->mxAccessible.is() )
233  {
234  Reference< XComponent> xC( mpWindowImpl->mxAccessible, UNO_QUERY );
235  if ( xC.is() )
236  xC->dispose();
237  }
238 
239  ImplSVData* pSVData = ImplGetSVData();
240 
241  if ( ImplGetSVHelpData().mpHelpWin && (ImplGetSVHelpData().mpHelpWin->GetParent() == this) )
242  ImplDestroyHelpWindow( true );
243 
244  SAL_WARN_IF(pSVData->mpWinData->mpTrackWin.get() == this, "vcl.window",
245  "Window::~Window(): Window is in TrackingMode");
246  SAL_WARN_IF(IsMouseCaptured(), "vcl.window",
247  "Window::~Window(): Window has the mouse captured");
248 
249  // due to old compatibility
250  if (pSVData->mpWinData->mpTrackWin == this)
251  EndTracking();
252  if (IsMouseCaptured())
253  ReleaseMouse();
254 
255 #if OSL_DEBUG_LEVEL > 0
256  // always perform these tests in debug builds
257  {
258  OStringBuffer aErrorStr;
259  bool bError = false;
260  vcl::Window* pTempWin;
261 
262  if ( mpWindowImpl->mpFirstChild )
263  {
264  OStringBuffer aTempStr("Window (");
265  aTempStr.append(lcl_createWindowInfo(this));
266  aTempStr.append(") with live children destroyed: ");
267  pTempWin = mpWindowImpl->mpFirstChild;
268  while ( pTempWin )
269  {
270  aTempStr.append(lcl_createWindowInfo(pTempWin));
271  pTempWin = pTempWin->mpWindowImpl->mpNext;
272  }
273  OSL_FAIL( aTempStr.getStr() );
274  Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed!
275  }
276 
277  if (mpWindowImpl->mpFrameData != nullptr)
278  {
279  pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
280  while ( pTempWin )
281  {
282  if ( ImplIsRealParentPath( pTempWin ) )
283  {
284  bError = true;
285  aErrorStr.append(lcl_createWindowInfo(pTempWin));
286  }
287  pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
288  }
289  if ( bError )
290  {
291  OStringBuffer aTempStr;
292  aTempStr.append("Window (");
293  aTempStr.append(lcl_createWindowInfo(this));
294  aTempStr.append(") with live SystemWindows destroyed: ");
295  aTempStr.append(aErrorStr.toString());
296  OSL_FAIL(aTempStr.getStr());
297  // abort in debug builds, must be fixed!
298  Application::Abort(OStringToOUString(
299  aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8));
300  }
301  }
302 
303  bError = false;
304  pTempWin = pSVData->maFrameData.mpFirstFrame;
305  while ( pTempWin )
306  {
307  if ( ImplIsRealParentPath( pTempWin ) )
308  {
309  bError = true;
310  aErrorStr.append(lcl_createWindowInfo(pTempWin));
311  }
312  pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame;
313  }
314  if ( bError )
315  {
316  OStringBuffer aTempStr( "Window (" );
317  aTempStr.append(lcl_createWindowInfo(this));
318  aTempStr.append(") with live SystemWindows destroyed: ");
319  aTempStr.append(aErrorStr.toString());
320  OSL_FAIL( aTempStr.getStr() );
321  Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed!
322  }
323 
324  if ( mpWindowImpl->mpFirstOverlap )
325  {
326  OStringBuffer aTempStr("Window (");
327  aTempStr.append(lcl_createWindowInfo(this));
328  aTempStr.append(") with live SystemWindows destroyed: ");
329  pTempWin = mpWindowImpl->mpFirstOverlap;
330  while ( pTempWin )
331  {
332  aTempStr.append(lcl_createWindowInfo(pTempWin));
333  pTempWin = pTempWin->mpWindowImpl->mpNext;
334  }
335  OSL_FAIL( aTempStr.getStr() );
336  Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed!
337  }
338 
339  vcl::Window* pMyParent = GetParent();
340  SystemWindow* pMySysWin = nullptr;
341 
342  while ( pMyParent )
343  {
344  if ( pMyParent->IsSystemWindow() )
345  {
346  pMySysWin = dynamic_cast<SystemWindow *>(pMyParent);
347  }
348  pMyParent = pMyParent->GetParent();
349  }
350  if ( pMySysWin && pMySysWin->ImplIsInTaskPaneList( this ) )
351  {
352  OStringBuffer aTempStr("Window (");
353  aTempStr.append(lcl_createWindowInfo(this));
354  aTempStr.append(") still in TaskPanelList!");
355  OSL_FAIL( aTempStr.getStr() );
356  Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed!
357  }
358  }
359 #endif
360 
361  if( mpWindowImpl->mbIsInTaskPaneList )
362  {
363  vcl::Window* pMyParent = GetParent();
364  SystemWindow* pMySysWin = nullptr;
365 
366  while ( pMyParent )
367  {
368  if ( pMyParent->IsSystemWindow() )
369  {
370  pMySysWin = dynamic_cast<SystemWindow *>(pMyParent);
371  }
372  pMyParent = pMyParent->GetParent();
373  }
374  if ( pMySysWin && pMySysWin->ImplIsInTaskPaneList( this ) )
375  {
376  pMySysWin->GetTaskPaneList()->RemoveWindow( this );
377  }
378  else
379  {
380  SAL_WARN( "vcl", "Window (" << GetText() << ") not found in TaskPanelList");
381  }
382  }
383 
384  // remove from size-group if necessary
386 
387  // clear mnemonic labels
388  std::vector<VclPtr<FixedText> > aMnemonicLabels(list_mnemonic_labels());
389  for (auto const& mnemonicLabel : aMnemonicLabels)
390  {
391  remove_mnemonic_label(mnemonicLabel);
392  }
393 
394  // hide window in order to trigger the Paint-Handling
395  Hide();
396 
397  // EndExtTextInputMode
398  if (pSVData->mpWinData->mpExtTextInputWin == this)
399  {
400  EndExtTextInput();
401  if (pSVData->mpWinData->mpExtTextInputWin == this)
402  pSVData->mpWinData->mpExtTextInputWin = nullptr;
403  }
404 
405  // check if the focus window is our child
406  bool bHasFocussedChild = false;
407  if (pSVData->mpWinData->mpFocusWin && ImplIsRealParentPath(pSVData->mpWinData->mpFocusWin))
408  {
409  // #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below
410  bHasFocussedChild = true;
411 #if OSL_DEBUG_LEVEL > 0
412  OUString aTempStr = "Window (" + GetText() +
413  ") with focused child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !";
414  SAL_WARN( "vcl", aTempStr );
415  Application::Abort(aTempStr); // abort in debug build version, this must be fixed!
416 #endif
417  }
418 
419  // if we get focus pass focus to another window
420  vcl::Window* pOverlapWindow = ImplGetFirstOverlapWindow();
421  if (pSVData->mpWinData->mpFocusWin == this
422  || bHasFocussedChild) // #122232#, see above, try some cleanup
423  {
424  if ( mpWindowImpl->mbFrame )
425  {
426  pSVData->mpWinData->mpFocusWin = nullptr;
427  pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
428  }
429  else
430  {
431  vcl::Window* pParent = GetParent();
432  vcl::Window* pBorderWindow = mpWindowImpl->mpBorderWindow;
433  // when windows overlap, give focus to the parent
434  // of the next FrameWindow
435  if ( pBorderWindow )
436  {
437  if ( pBorderWindow->ImplIsOverlapWindow() )
438  pParent = pBorderWindow->mpWindowImpl->mpOverlapWindow;
439  }
440  else if ( ImplIsOverlapWindow() )
441  pParent = mpWindowImpl->mpOverlapWindow;
442 
443  if ( pParent && pParent->IsEnabled() && pParent->IsInputEnabled() && ! pParent->IsInModalMode() )
444  pParent->GrabFocus();
445  else
446  mpWindowImpl->mpFrameWindow->GrabFocus();
447 
448  // If the focus was set back to 'this' set it to nothing
449  if (pSVData->mpWinData->mpFocusWin == this)
450  {
451  pSVData->mpWinData->mpFocusWin = nullptr;
452  pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
453  }
454  }
455  }
456 
457  if ( pOverlapWindow != nullptr &&
458  pOverlapWindow->mpWindowImpl->mpLastFocusWindow == this )
459  pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
460 
461  // reset hint for DefModalDialogParent
462  if( pSVData->maFrameData.mpActiveApplicationFrame == this )
463  pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
464 
465  // reset hint of what was the last wheeled window
466  if (pSVData->mpWinData->mpLastWheelWindow == this)
467  pSVData->mpWinData->mpLastWheelWindow = nullptr;
468 
469  // reset marked windows
470  if ( mpWindowImpl->mpFrameData != nullptr )
471  {
472  if ( mpWindowImpl->mpFrameData->mpFocusWin == this )
473  mpWindowImpl->mpFrameData->mpFocusWin = nullptr;
474  if ( mpWindowImpl->mpFrameData->mpMouseMoveWin == this )
475  mpWindowImpl->mpFrameData->mpMouseMoveWin = nullptr;
476  if ( mpWindowImpl->mpFrameData->mpMouseDownWin == this )
477  mpWindowImpl->mpFrameData->mpMouseDownWin = nullptr;
478  }
479 
480  // reset Deactivate-Window
481  if (pSVData->mpWinData->mpLastDeacWin == this)
482  pSVData->mpWinData->mpLastDeacWin = nullptr;
483 
484  if ( mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData )
485  {
486  if ( mpWindowImpl->mpFrameData->mnFocusId )
487  Application::RemoveUserEvent( mpWindowImpl->mpFrameData->mnFocusId );
488  mpWindowImpl->mpFrameData->mnFocusId = nullptr;
489  if ( mpWindowImpl->mpFrameData->mnMouseMoveId )
490  Application::RemoveUserEvent( mpWindowImpl->mpFrameData->mnMouseMoveId );
491  mpWindowImpl->mpFrameData->mnMouseMoveId = nullptr;
492  }
493 
494  // release SalGraphics
495  OutputDevice *pOutDev = GetOutDev();
496  pOutDev->ReleaseGraphics();
497 
498  // remove window from the lists
499  ImplRemoveWindow( true );
500 
501  // de-register as "top window child" at our parent, if necessary
502  if ( mpWindowImpl->mbFrame )
503  {
504  bool bIsTopWindow
505  = mpWindowImpl->mpWinData && (mpWindowImpl->mpWinData->mnIsTopWindow == 1);
506  if ( mpWindowImpl->mpRealParent && bIsTopWindow )
507  {
508  ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData();
509 
510  auto myPos = ::std::find( pParentWinData->maTopWindowChildren.begin(),
511  pParentWinData->maTopWindowChildren.end(), VclPtr<vcl::Window>(this) );
512  SAL_WARN_IF( myPos == pParentWinData->maTopWindowChildren.end(), "vcl.window", "Window::~Window: inconsistency in top window chain!" );
513  if ( myPos != pParentWinData->maTopWindowChildren.end() )
514  pParentWinData->maTopWindowChildren.erase( myPos );
515  }
516  }
517 
518  delete mpWindowImpl->mpWinData;
519  mpWindowImpl->mpWinData = nullptr;
520 
521  // remove BorderWindow or Frame window data
522  mpWindowImpl->mpBorderWindow.disposeAndClear();
523  if ( mpWindowImpl->mbFrame )
524  {
525  if ( pSVData->maFrameData.mpFirstFrame == this )
526  pSVData->maFrameData.mpFirstFrame = mpWindowImpl->mpFrameData->mpNextFrame;
527  else
528  {
529  sal_Int32 nWindows = 0;
530  vcl::Window* pSysWin = pSVData->maFrameData.mpFirstFrame;
531  while ( pSysWin && pSysWin->mpWindowImpl->mpFrameData->mpNextFrame.get() != this )
532  {
533  pSysWin = pSysWin->mpWindowImpl->mpFrameData->mpNextFrame;
534  nWindows++;
535  }
536 
537  if ( pSysWin )
538  {
539  assert (mpWindowImpl->mpFrameData->mpNextFrame.get() != pSysWin);
540  pSysWin->mpWindowImpl->mpFrameData->mpNextFrame = mpWindowImpl->mpFrameData->mpNextFrame;
541  }
542  else // if it is not in the list, we can't remove it.
543  SAL_WARN("vcl.window", "Window " << this << " marked as frame window, "
544  "is missing from list of " << nWindows << " frames");
545  }
546  if (mpWindowImpl->mpFrame) // otherwise exception during init
547  {
548  mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr );
549  pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame );
550  }
551  assert (mpWindowImpl->mpFrameData->mnFocusId == nullptr);
552  assert (mpWindowImpl->mpFrameData->mnMouseMoveId == nullptr);
553 
554  mpWindowImpl->mpFrameData->mpBuffer.disposeAndClear();
555  delete mpWindowImpl->mpFrameData;
556  mpWindowImpl->mpFrameData = nullptr;
557  }
558 
559  // should be the last statements
560  mpWindowImpl.reset();
561 
563 }
564 
566 {
567  disposeOnce();
568 }
569 
570 // We will eventually being removing the inheritance of OutputDevice
571 // from Window. It will be replaced with a transient relationship such
572 // that the OutputDevice is only live for the scope of the Paint method.
573 // In the meantime this can help move us towards a Window use an
574 // OutputDevice, not being one.
575 
577 {
578  return this;
579 }
580 
582 {
583  return this;
584 }
585 
587 {
588  return GetDisplayBackground().GetColor();
589 }
590 
591 } /* namespace vcl */
592 
594 {
595  maZoom = Fraction( 1, 1 );
596  maWinRegion = vcl::Region(true);
598  mpWinData = nullptr; // Extra Window Data, that we don't need for all windows
599  mpFrameData = nullptr; // Frame Data
600  mpFrame = nullptr; // Pointer to frame window
601  mpSysObj = nullptr;
602  mpFrameWindow = nullptr; // window to top level parent (same as frame window)
603  mpOverlapWindow = nullptr; // first overlap parent
604  mpBorderWindow = nullptr; // Border-Window
605  mpClientWindow = nullptr; // Client-Window of a FrameWindow
606  mpParent = nullptr; // parent (incl. BorderWindow)
607  mpRealParent = nullptr; // real parent (excl. BorderWindow)
608  mpFirstChild = nullptr; // first child window
609  mpLastChild = nullptr; // last child window
610  mpFirstOverlap = nullptr; // first overlap window (only set in overlap windows)
611  mpLastOverlap = nullptr; // last overlap window (only set in overlap windows)
612  mpPrev = nullptr; // prev window
613  mpNext = nullptr; // next window
614  mpNextOverlap = nullptr; // next overlap window of frame
615  mpLastFocusWindow = nullptr; // window for focus restore
616  mpDlgCtrlDownWindow = nullptr; // window for dialog control
619  mpCursor = nullptr; // cursor
621  mpVCLXWindow = nullptr;
622  mpAccessibleInfos = nullptr;
623  maControlForeground = COL_TRANSPARENT; // no foreground set
624  maControlBackground = COL_TRANSPARENT; // no background set
625  mnLeftBorder = 0; // left border
626  mnTopBorder = 0; // top border
627  mnRightBorder = 0; // right border
628  mnBottomBorder = 0; // bottom border
629  mnWidthRequest = -1; // width request
630  mnHeightRequest = -1; // height request
631  mnOptimalWidthCache = -1; // optimal width cache
632  mnOptimalHeightCache = -1; // optimal height cache
633  mnX = 0; // X-Position to Parent
634  mnY = 0; // Y-Position to Parent
635  mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
636  mpChildClipRegion = nullptr; // Child-Clip-Region when ClipChildren
637  mpPaintRegion = nullptr; // Paint-ClipRegion
638  mnStyle = 0; // style (init in ImplInitWindow)
639  mnPrevStyle = 0; // prevstyle (set in SetStyle)
640  mnExtendedStyle = WindowExtendedStyle::NONE; // extended style (init in ImplInitWindow)
641  mnType = nType; // type
642  mnGetFocusFlags = GetFocusFlags::NONE; // Flags for GetFocus()-Call
643  mnWaitCount = 0; // Wait-Count (>1 == "wait" mouse pointer)
644  mnPaintFlags = ImplPaintFlags::NONE; // Flags for ImplCallPaint
645  mnParentClipMode = ParentClipMode::NONE; // Flags for Parent-ClipChildren-Mode
646  mnActivateMode = ActivateModeFlags::NONE; // Will be converted in System/Overlap-Windows
647  mnDlgCtrlFlags = DialogControlFlags::NONE; // DialogControl-Flags
648  meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
652  mnPadding = 0;
653  mnGridHeight = 1;
654  mnGridLeftAttach = -1;
655  mnGridTopAttach = -1;
656  mnGridWidth = 1;
657  mnBorderWidth = 0;
658  mnMarginLeft = 0;
659  mnMarginRight = 0;
660  mnMarginTop = 0;
661  mnMarginBottom = 0;
662  mbFrame = false; // true: Window is a frame window
663  mbBorderWin = false; // true: Window is a border window
664  mbOverlapWin = false; // true: Window is an overlap window
665  mbSysWin = false; // true: SystemWindow is the base class
666  mbDialog = false; // true: Dialog is the base class
667  mbDockWin = false; // true: DockingWindow is the base class
668  mbFloatWin = false; // true: FloatingWindow is the base class
669  mbPushButton = false; // true: PushButton is the base class
670  mbToolBox = false; // true: ToolBox is the base class
671  mbMenuFloatingWindow = false; // true: MenuFloatingWindow is the base class
672  mbToolbarFloatingWindow = false; // true: ImplPopupFloatWin is the base class, used for subtoolbars
673  mbSplitter = false; // true: Splitter is the base class
674  mbVisible = false; // true: Show( true ) called
675  mbOverlapVisible = false; // true: Hide called for visible window from ImplHideAllOverlapWindow()
676  mbDisabled = false; // true: Enable( false ) called
677  mbInputDisabled = false; // true: EnableInput( false ) called
678  mbNoUpdate = false; // true: SetUpdateMode( false ) called
679  mbNoParentUpdate = false; // true: SetParentUpdateMode( false ) called
680  mbActive = false; // true: Window Active
681  mbReallyVisible = false; // true: this and all parents to an overlapped window are visible
682  mbReallyShown = false; // true: this and all parents to an overlapped window are shown
683  mbInInitShow = false; // true: we are in InitShow
684  mbChildPtrOverwrite = false; // true: PointerStyle overwrites Child-Pointer
685  mbNoPtrVisible = false; // true: ShowPointer( false ) called
686  mbPaintFrame = false; // true: Paint is visible, but not painted
687  mbInPaint = false; // true: Inside PaintHdl
688  mbMouseButtonDown = false; // true: BaseMouseButtonDown called
689  mbMouseButtonUp = false; // true: BaseMouseButtonUp called
690  mbKeyInput = false; // true: BaseKeyInput called
691  mbKeyUp = false; // true: BaseKeyUp called
692  mbCommand = false; // true: BaseCommand called
693  mbDefPos = true; // true: Position is not Set
694  mbDefSize = true; // true: Size is not Set
695  mbCallMove = true; // true: Move must be called by Show
696  mbCallResize = true; // true: Resize must be called by Show
697  mbWaitSystemResize = true; // true: Wait for System-Resize
698  mbInitWinClipRegion = true; // true: Calc Window Clip Region
699  mbInitChildRegion = false; // true: InitChildClipRegion
700  mbWinRegion = false; // true: Window Region
701  mbClipChildren = false; // true: Child-window should be clipped
702  mbClipSiblings = false; // true: Adjacent Child-window should be clipped
703  mbChildTransparent = false; // true: Child-windows are allowed to switch to transparent (incl. Parent-CLIPCHILDREN)
704  mbPaintTransparent = false; // true: Paints should be executed on the Parent
705  mbMouseTransparent = false; // true: Window is transparent for Mouse
706  mbDlgCtrlStart = false; // true: From here on own Dialog-Control
707  mbFocusVisible = false; // true: Focus Visible
708  mbUseNativeFocus = false;
709  mbNativeFocusVisible = false; // true: native Focus Visible
710  mbInShowFocus = false; // prevent recursion
711  mbInHideFocus = false; // prevent recursion
712  mbTrackVisible = false; // true: Tracking Visible
713  mbControlForeground = false; // true: Foreground-Property set
714  mbControlBackground = false; // true: Background-Property set
715  mbAlwaysOnTop = false; // true: always visible for all others windows
716  mbCompoundControl = false; // true: Composite Control => Listener...
717  mbCompoundControlHasFocus = false; // true: Composite Control has focus somewhere
718  mbPaintDisabled = false; // true: Paint should not be executed
719  mbAllResize = false; // true: Also sent ResizeEvents with 0,0
720  mbInDispose = false; // true: We're still in Window::dispose()
721  mbExtTextInput = false; // true: ExtTextInput-Mode is active
722  mbInFocusHdl = false; // true: Within GetFocus-Handler
723  mbCreatedWithToolkit = false;
724  mbSuppressAccessibilityEvents = false; // true: do not send any accessibility events
725  mbDrawSelectionBackground = false; // true: draws transparent window background to indicate (toolbox) selection
726  mbIsInTaskPaneList = false; // true: window was added to the taskpanelist in the topmost system window
727  mnNativeBackground = ControlPart::NONE; // initialize later, depends on type
728  mbCallHandlersDuringInputDisabled = false; // true: call event handlers even if input is disabled
729  mbHelpTextDynamic = false; // true: append help id in HELP_DEBUG case
730  mbFakeFocusSet = false; // true: pretend as if the window has focus.
731  mbHexpand = false;
732  mbVexpand = false;
733  mbExpand = false;
734  mbFill = true;
735  mbSecondary = false;
736  mbNonHomogeneous = false;
737  static bool bDoubleBuffer = getenv("VCL_DOUBLEBUFFERING_FORCE_ENABLE");
738  mbDoubleBufferingRequested = bDoubleBuffer; // when we are not sure, assume it cannot do double-buffering via RenderContext
739  mpLOKNotifier = nullptr;
740  mnLOKWindowId = 0;
741  mbLOKParentNotifier = false;
742 }
743 
745 {
746  mpChildClipRegion.reset();
747  mpAccessibleInfos.reset();
748 }
749 
751  mnCursorExtWidth(0),
752  mbVertical(false),
753  mnCompositionCharRects(0),
754  mnTrackFlags(ShowTrackFlags::NONE),
755  mnIsTopWindow(sal_uInt16(~0)), // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
756  mbMouseOver(false),
757  mbEnableNativeWidget(false)
758 {
759 }
760 
762 {
763  mpCompositionCharRects.reset();
764 }
765 
767 {
768  ImplSVData* pSVData = ImplGetSVData();
769  assert (pSVData->maFrameData.mpFirstFrame.get() != pWindow);
771  pSVData->maFrameData.mpFirstFrame = pWindow;
772  mpFirstOverlap = nullptr;
773  mpFocusWin = nullptr;
774  mpMouseMoveWin = nullptr;
775  mpMouseDownWin = nullptr;
778  mnFocusId = nullptr;
779  mnMouseMoveId = nullptr;
780  mnLastMouseX = -1;
781  mnLastMouseY = -1;
782  mnBeforeLastMouseX = -1;
783  mnBeforeLastMouseY = -1;
784  mnFirstMouseX = -1;
785  mnFirstMouseY = -1;
786  mnLastMouseWinX = -1;
787  mnLastMouseWinY = -1;
788  mnModalMode = 0;
789  mnMouseDownTime = 0;
790  mnClickCount = 0;
791  mnFirstMouseCode = 0;
792  mnMouseCode = 0;
794  mbHasFocus = false;
795  mbInMouseMove = false;
796  mbMouseIn = false;
797  mbStartDragCalled = false;
798  mbNeedSysWindow = false;
799  mbMinimized = false;
800  mbStartFocusState = false;
801  mbInSysObjFocusHdl = false;
802  mbInSysObjToTopHdl = false;
803  mbSysObjFocus = false;
805  maPaintIdle.SetInvokeHandler( LINK( pWindow, vcl::Window, ImplHandlePaintHdl ) );
806  maPaintIdle.SetDebugName( "vcl::Window maPaintIdle" );
808  maResizeIdle.SetInvokeHandler( LINK( pWindow, vcl::Window, ImplHandleResizeTimerHdl ) );
809  maResizeIdle.SetDebugName( "vcl::Window maResizeIdle" );
811  mbInBufferedPaint = false;
812  mnDPIX = 96;
813  mnDPIY = 96;
814  mnTouchPanPosition = -1;
815 }
816 
817 namespace vcl {
818 
820 {
822 
823  if ( mpGraphics )
824  return true;
825 
826  mbInitLineColor = true;
827  mbInitFillColor = true;
828  mbInitFont = true;
829  mbInitTextColor = true;
830  mbInitClipRegion = true;
831 
832  ImplSVData* pSVData = ImplGetSVData();
833 
834  mpGraphics = mpWindowImpl->mpFrame->AcquireGraphics();
835  // try harder if no wingraphics was available directly
836  if ( !mpGraphics )
837  {
838  // find another output device in the same frame
839  OutputDevice* pReleaseOutDev = pSVData->maGDIData.mpLastWinGraphics;
840  while ( pReleaseOutDev )
841  {
842  if ( static_cast<vcl::Window*>(pReleaseOutDev)->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame )
843  break;
844  pReleaseOutDev = pReleaseOutDev->mpPrevGraphics;
845  }
846 
847  if ( pReleaseOutDev )
848  {
849  // steal the wingraphics from the other outdev
850  mpGraphics = pReleaseOutDev->mpGraphics;
851  pReleaseOutDev->ReleaseGraphics( false );
852  }
853  else
854  {
855  // if needed retry after releasing least recently used wingraphics
856  while ( !mpGraphics )
857  {
858  if ( !pSVData->maGDIData.mpLastWinGraphics )
859  break;
861  mpGraphics = mpWindowImpl->mpFrame->AcquireGraphics();
862  }
863  }
864  }
865 
866  if ( mpGraphics )
867  {
868  // update global LRU list of wingraphics
870  pSVData->maGDIData.mpFirstWinGraphics = const_cast<vcl::Window*>(this);
871  if ( mpNextGraphics )
872  mpNextGraphics->mpPrevGraphics = const_cast<vcl::Window*>(this);
873  if ( !pSVData->maGDIData.mpLastWinGraphics )
874  pSVData->maGDIData.mpLastWinGraphics = const_cast<vcl::Window*>(this);
875 
878  }
879 
880  return mpGraphics != nullptr;
881 }
882 
883 void Window::ReleaseGraphics( bool bRelease )
884 {
886 
887  if ( !mpGraphics )
888  return;
889 
890  // release the fonts of the physically released graphics device
891  if( bRelease )
893 
894  ImplSVData* pSVData = ImplGetSVData();
895 
896  vcl::Window* pWindow = this;
897 
898  if ( bRelease )
899  pWindow->mpWindowImpl->mpFrame->ReleaseGraphics( mpGraphics );
900  // remove from global LRU list of window graphics
901  if ( mpPrevGraphics )
903  else
905  if ( mpNextGraphics )
907  else
909 
910  mpGraphics = nullptr;
911  mpPrevGraphics = nullptr;
912  mpNextGraphics = nullptr;
913 }
914 
915 static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
916 {
917 #ifndef MACOSX
918  // Setting of HiDPI is unfortunately all only a heuristic; and to add
919  // insult to an injury, the system is constantly lying to us about
920  // the DPI and whatnot
921  // eg. fdo#77059 - set the value from which we do consider the
922  // screen HiDPI to greater than 168
923  if (nDPI > 216) // 96 * 2 + 96 / 4
924  return 250;
925  else if (nDPI > 168) // 96 * 2 - 96 / 4
926  return 200;
927  else if (nDPI > 120) // 96 * 1.5 - 96 / 4
928  return 150;
929 #else
930  (void)nDPI;
931 #endif
932 
933  return 100;
934 }
935 
936 void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
937 {
938  SAL_WARN_IF( !mpWindowImpl->mbFrame && !pParent && GetType() != WindowType::FIXEDIMAGE, "vcl.window",
939  "Window::Window(): pParent == NULL" );
940 
941  ImplSVData* pSVData = ImplGetSVData();
942  vcl::Window* pRealParent = pParent;
943 
944  // inherit 3D look
945  if ( !mpWindowImpl->mbOverlapWin && pParent && (pParent->GetStyle() & WB_3DLOOK) )
946  nStyle |= WB_3DLOOK;
947 
948  // create border window if necessary
949  if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow
950  && (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
951  {
952  BorderWindowStyle nBorderTypeStyle = BorderWindowStyle::NONE;
953  if( nStyle & WB_SYSTEMCHILDWINDOW )
954  {
955  // handle WB_SYSTEMCHILDWINDOW
956  // these should be analogous to a top level frame; meaning they
957  // should have a border window with style BorderWindowStyle::Frame
958  // which controls their size
959  nBorderTypeStyle |= BorderWindowStyle::Frame;
960  nStyle |= WB_BORDER;
961  }
962  VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL), nBorderTypeStyle );
963  static_cast<vcl::Window*>(pBorderWin)->mpWindowImpl->mpClientWindow = this;
964  pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
965  mpWindowImpl->mpBorderWindow = pBorderWin;
966  pParent = mpWindowImpl->mpBorderWindow;
967  }
968  else if( !mpWindowImpl->mbFrame && ! pParent )
969  {
970  mpWindowImpl->mbOverlapWin = true;
971  mpWindowImpl->mbFrame = true;
972  }
973 
974  // insert window in list
975  ImplInsertWindow( pParent );
976  mpWindowImpl->mnStyle = nStyle;
977 
978  if( pParent && ! mpWindowImpl->mbFrame )
980 
981  // test for frame creation
982  if ( mpWindowImpl->mbFrame )
983  {
984  // create frame
986 
987  if ( nStyle & WB_MOVEABLE )
988  nFrameStyle |= SalFrameStyleFlags::MOVEABLE;
989  if ( nStyle & WB_SIZEABLE )
990  nFrameStyle |= SalFrameStyleFlags::SIZEABLE;
991  if ( nStyle & WB_CLOSEABLE )
992  nFrameStyle |= SalFrameStyleFlags::CLOSEABLE;
993  if ( nStyle & WB_APP )
994  nFrameStyle |= SalFrameStyleFlags::DEFAULT;
995  // check for undecorated floating window
996  if( // 1. floating windows that are not moveable/sizeable (only closeable allowed)
997  ( !(nFrameStyle & ~SalFrameStyleFlags::CLOSEABLE) &&
998  ( mpWindowImpl->mbFloatWin || ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) ||
999  // 2. borderwindows of floaters with ownerdraw decoration
1000  ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) )
1001  {
1002  nFrameStyle = SalFrameStyleFlags::FLOAT;
1003  if( nStyle & WB_OWNERDRAWDECORATION )
1005  }
1006  else if( mpWindowImpl->mbFloatWin )
1007  nFrameStyle |= SalFrameStyleFlags::TOOLWINDOW;
1008 
1009  if( nStyle & WB_INTROWIN )
1010  nFrameStyle |= SalFrameStyleFlags::INTRO;
1011  if( nStyle & WB_TOOLTIPWIN )
1012  nFrameStyle |= SalFrameStyleFlags::TOOLTIP;
1013 
1014  if( nStyle & WB_NOSHADOW )
1015  nFrameStyle |= SalFrameStyleFlags::NOSHADOW;
1016 
1017  if( nStyle & WB_SYSTEMCHILDWINDOW )
1018  nFrameStyle |= SalFrameStyleFlags::SYSTEMCHILD;
1019 
1020  switch (mpWindowImpl->mnType)
1021  {
1022  case WindowType::DIALOG:
1023  case WindowType::TABDIALOG:
1024  case WindowType::MODELESSDIALOG:
1025  case WindowType::MESSBOX:
1026  case WindowType::INFOBOX:
1027  case WindowType::WARNINGBOX:
1028  case WindowType::ERRORBOX:
1029  case WindowType::QUERYBOX:
1030  nFrameStyle |= SalFrameStyleFlags::DIALOG;
1031  break;
1032  default:
1033  break;
1034  }
1035 
1036  SalFrame* pParentFrame = nullptr;
1037  if ( pParent )
1038  pParentFrame = pParent->mpWindowImpl->mpFrame;
1039  SalFrame* pFrame;
1040  if ( pSystemParentData )
1041  pFrame = pSVData->mpDefInst->CreateChildFrame( pSystemParentData, nFrameStyle | SalFrameStyleFlags::PLUG );
1042  else
1043  pFrame = pSVData->mpDefInst->CreateFrame( pParentFrame, nFrameStyle );
1044  if ( !pFrame )
1045  {
1046  // do not abort but throw an exception, may be the current thread terminates anyway (plugin-scenario)
1047  throw RuntimeException(
1048  "Could not create system window!",
1050  }
1051 
1052  pFrame->SetCallback( this, ImplWindowFrameProc );
1053 
1054  // set window frame data
1055  mpWindowImpl->mpFrameData = new ImplFrameData( this );
1056  mpWindowImpl->mpFrame = pFrame;
1057  mpWindowImpl->mpFrameWindow = this;
1058  mpWindowImpl->mpOverlapWindow = this;
1059 
1060  if (!(nStyle & WB_DEFAULTWIN) && mpWindowImpl->mbDoubleBufferingRequested)
1061  RequestDoubleBuffering(true);
1062 
1063  if ( pRealParent && IsTopWindow() )
1064  {
1065  ImplWinData* pParentWinData = pRealParent->ImplGetWinData();
1066  pParentWinData->maTopWindowChildren.emplace_back(this );
1067  }
1068  }
1069 
1070  // init data
1071  mpWindowImpl->mpRealParent = pRealParent;
1072 
1073  // #99318: make sure fontcache and list is available before call to SetSettings
1074  mxFontCollection = mpWindowImpl->mpFrameData->mxFontCollection;
1075  mxFontCache = mpWindowImpl->mpFrameData->mxFontCache;
1076 
1077  if ( mpWindowImpl->mbFrame )
1078  {
1079  if ( pParent )
1080  {
1081  mpWindowImpl->mpFrameData->mnDPIX = pParent->mpWindowImpl->mpFrameData->mnDPIX;
1082  mpWindowImpl->mpFrameData->mnDPIY = pParent->mpWindowImpl->mpFrameData->mnDPIY;
1083  }
1084  else
1085  {
1086  OutputDevice *pOutDev = GetOutDev();
1087  if ( pOutDev->AcquireGraphics() )
1088  {
1089  mpGraphics->GetResolution( mpWindowImpl->mpFrameData->mnDPIX, mpWindowImpl->mpFrameData->mnDPIY );
1090  }
1091  }
1092 
1093  // add ownerdraw decorated frame windows to list in the top-most frame window
1094  // so they can be hidden on lose focus
1095  if( nStyle & WB_OWNERDRAWDECORATION )
1096  ImplGetOwnerDrawList().emplace_back(this );
1097 
1098  // delay settings initialization until first "real" frame
1099  // this relies on the IntroWindow not needing any system settings
1100  if ( !pSVData->maAppData.mbSettingsInit &&
1101  ! (nStyle & (WB_INTROWIN|WB_DEFAULTWIN))
1102  )
1103  {
1104  // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
1107  pSVData->maAppData.mbSettingsInit = true;
1108  }
1109 
1110  // If we create a Window with default size, query this
1111  // size directly, because we want resize all Controls to
1112  // the correct size before we display the window
1113  if ( nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_APP) )
1114  mpWindowImpl->mpFrame->GetClientSize( mnOutWidth, mnOutHeight );
1115  }
1116  else
1117  {
1118  if ( pParent )
1119  {
1120  if ( !ImplIsOverlapWindow() )
1121  {
1122  mpWindowImpl->mbDisabled = pParent->mpWindowImpl->mbDisabled;
1123  mpWindowImpl->mbInputDisabled = pParent->mpWindowImpl->mbInputDisabled;
1124  mpWindowImpl->meAlwaysInputMode = pParent->mpWindowImpl->meAlwaysInputMode;
1125  }
1126 
1128  OutputDevice::SetSettings( pParent->GetSettings() );
1129  }
1130 
1131  }
1132 
1133  // setup the scale factor for HiDPI displays
1134  mnDPIScalePercentage = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
1135  mnDPIX = mpWindowImpl->mpFrameData->mnDPIX;
1136  mnDPIY = mpWindowImpl->mpFrameData->mnDPIY;
1137 
1139  {
1140  const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
1141  maFont = rStyleSettings.GetAppFont();
1142 
1143  if ( nStyle & WB_3DLOOK )
1144  {
1145  SetTextColor( rStyleSettings.GetButtonTextColor() );
1146  SetBackground( Wallpaper( rStyleSettings.GetFaceColor() ) );
1147  }
1148  else
1149  {
1150  SetTextColor( rStyleSettings.GetWindowTextColor() );
1151  SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) );
1152  }
1153  }
1154  else
1155  {
1157  }
1158 
1159  ImplPointToLogic(*this, maFont);
1160 
1161  (void)ImplUpdatePos();
1162 
1163  // calculate app font res (except for the Intro Window or the default window)
1164  if ( mpWindowImpl->mbFrame && !pSVData->maGDIData.mnAppFontX && ! (nStyle & (WB_INTROWIN|WB_DEFAULTWIN)) )
1165  ImplInitAppFontData( this );
1166 }
1167 
1169 {
1170  ImplSVData* pSVData = ImplGetSVData();
1171  long nTextHeight = pWindow->GetTextHeight();
1172  long nTextWidth = pWindow->approximate_char_width() * 8;
1173  long nSymHeight = nTextHeight*4;
1174  // Make the basis wider if the font is too narrow
1175  // such that the dialog looks symmetrical and does not become too narrow.
1176  // Add some extra space when the dialog has the same width,
1177  // as a little more space is better.
1178  if ( nSymHeight > nTextWidth )
1179  nTextWidth = nSymHeight;
1180  else if ( nSymHeight+5 > nTextWidth )
1181  nTextWidth = nSymHeight+5;
1182  pSVData->maGDIData.mnAppFontX = nTextWidth * 10 / 8;
1183  pSVData->maGDIData.mnAppFontY = nTextHeight * 10;
1184 
1185 #ifdef MACOSX
1186  // FIXME: this is currently only on macOS, check with other
1187  // platforms
1188  if( pSVData->maNWFData.mbNoFocusRects )
1189  {
1190  // try to find out whether there is a large correction
1191  // of control sizes, if yes, make app font scalings larger
1192  // so dialog positioning is not completely off
1193  ImplControlValue aControlValue;
1194  tools::Rectangle aCtrlRegion( Point(), Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) );
1195  tools::Rectangle aBoundingRgn( aCtrlRegion );
1196  tools::Rectangle aContentRgn( aCtrlRegion );
1198  ControlState::ENABLED, aControlValue,
1199  aBoundingRgn, aContentRgn ) )
1200  {
1201  // comment: the magical +6 is for the extra border in bordered
1202  // (which is the standard) edit fields
1203  if( aContentRgn.GetHeight() - nTextHeight > (nTextHeight+4)/4 )
1204  pSVData->maGDIData.mnAppFontY = (aContentRgn.GetHeight()-4) * 10;
1205  }
1206  }
1207 #endif
1208 }
1209 
1211 {
1212  if (!mpWindowImpl->mpWinData)
1213  {
1214  static const char* pNoNWF = getenv( "SAL_NO_NWF" );
1215 
1216  const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData = new ImplWinData;
1217  mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF); // true: try to draw this control with native theme API
1218  }
1219 
1220  return mpWindowImpl->mpWinData;
1221 }
1222 
1223 
1224 void Window::CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate )
1225 {
1226  if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
1227  return;
1228 
1229  if (bWindowInvalidate)
1230  {
1231  const tools::Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY),
1232  Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight));
1233 
1235  aPosAry.mnDestX-aPosAry.mnSrcX,
1236  aPosAry.mnDestY-aPosAry.mnSrcY,
1237  false);
1238 
1239  mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY,
1240  aPosAry.mnSrcX, aPosAry.mnSrcY,
1241  aPosAry.mnSrcWidth, aPosAry.mnSrcHeight,
1242  this);
1243 
1244  return;
1245  }
1246 
1247  OutputDevice::CopyDeviceArea(aPosAry, bWindowInvalidate);
1248 }
1249 
1251 {
1252  const OutputDevice* pSrcDevChecked;
1253  if ( this == pSrcDev )
1254  pSrcDevChecked = nullptr;
1255  else if (GetOutDevType() != pSrcDev->GetOutDevType())
1256  pSrcDevChecked = pSrcDev;
1257  else if (this->mpWindowImpl->mpFrameWindow == static_cast<const vcl::Window*>(pSrcDev)->mpWindowImpl->mpFrameWindow)
1258  pSrcDevChecked = nullptr;
1259  else
1260  pSrcDevChecked = pSrcDev;
1261 
1262  return pSrcDevChecked;
1263 }
1264 
1265 void Window::DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
1266 {
1267  mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev );
1268 }
1269 
1271 {
1272  if ( mpWindowImpl->mpFrameWindow->mpGraphics )
1273  {
1274  mpWindowImpl->mpFrameWindow->mbInitClipRegion = true;
1275  }
1276  else
1277  {
1278  OutputDevice* pFrameWinOutDev = mpWindowImpl->mpFrameWindow;
1279  if ( ! pFrameWinOutDev->AcquireGraphics() )
1280  {
1281  return nullptr;
1282  }
1283  }
1284  mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion();
1285  return mpWindowImpl->mpFrameWindow->mpGraphics;
1286 }
1287 
1289 {
1290  // #i43594# it is possible that INITSHOW was never send, because the visibility state changed between
1291  // ImplCallInitShow() and ImplSetReallyVisible() when called from Show()
1292  // mbReallyShown is a useful indicator
1293  if( !mpWindowImpl->mbReallyShown )
1294  ImplCallInitShow();
1295 
1296  bool bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
1297 
1298  mbDevOutput = true;
1299  mpWindowImpl->mbReallyVisible = true;
1300  mpWindowImpl->mbReallyShown = true;
1301 
1302  // the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
1303  // For this, the data member of the event must not be NULL.
1304  // Previously, we did this in Window::Show, but there some events got lost in certain situations. Now
1305  // we're doing it when the visibility really changes
1306  if( bBecameReallyVisible && ImplIsAccessibleCandidate() )
1308  // TODO. It's kind of a hack that we're re-using the VclEventId::WindowShow. Normally, we should
1309  // introduce another event which explicitly triggers the Accessibility implementations.
1310 
1311  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
1312  while ( pWindow )
1313  {
1314  if ( pWindow->mpWindowImpl->mbVisible )
1315  pWindow->ImplSetReallyVisible();
1316  pWindow = pWindow->mpWindowImpl->mpNext;
1317  }
1318 
1319  pWindow = mpWindowImpl->mpFirstChild;
1320  while ( pWindow )
1321  {
1322  if ( pWindow->mpWindowImpl->mbVisible )
1323  pWindow->ImplSetReallyVisible();
1324  pWindow = pWindow->mpWindowImpl->mpNext;
1325  }
1326 }
1327 
1329 {
1330  // recalculate AppFont-resolution and DPI-resolution
1331  if (mpWindowImpl->mbFrame)
1332  {
1333  mnDPIX = mpWindowImpl->mpFrameData->mnDPIX;
1334  mnDPIY = mpWindowImpl->mpFrameData->mnDPIY;
1335 
1336  // setup the scale factor for HiDPI displays
1337  mnDPIScalePercentage = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
1338  const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
1339  SetPointFont(*this, rStyleSettings.GetAppFont());
1340  }
1341  else if ( mpWindowImpl->mpParent )
1342  {
1343  mnDPIX = mpWindowImpl->mpParent->mnDPIX;
1344  mnDPIY = mpWindowImpl->mpParent->mnDPIY;
1345  mnDPIScalePercentage = mpWindowImpl->mpParent->mnDPIScalePercentage;
1346  }
1347 
1348  // update the recalculated values for logical units
1349  // and also tools belonging to the values
1350  if (IsMapModeEnabled())
1351  {
1352  MapMode aMapMode = GetMapMode();
1353  SetMapMode();
1354  SetMapMode( aMapMode );
1355  }
1356 }
1357 
1358 void Window::ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const
1359 {
1360  Size aSize = rFont.GetFontSize();
1361 
1362  if (aSize.Width())
1363  {
1364  aSize.setWidth( aSize.Width() * ( mpWindowImpl->mpFrameData->mnDPIX) );
1365  aSize.AdjustWidth(72 / 2 );
1366  aSize.setWidth( aSize.Width() / 72 );
1367  }
1368  aSize.setHeight( aSize.Height() * ( mpWindowImpl->mpFrameData->mnDPIY) );
1369  aSize.AdjustHeight(72/2 );
1370  aSize.setHeight( aSize.Height() / 72 );
1371 
1372  if (rRenderContext.IsMapModeEnabled())
1373  aSize = rRenderContext.PixelToLogic(aSize);
1374 
1375  rFont.SetFontSize(aSize);
1376 }
1377 
1378 void Window::ImplLogicToPoint(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const
1379 {
1380  Size aSize = rFont.GetFontSize();
1381 
1382  if (rRenderContext.IsMapModeEnabled())
1383  aSize = rRenderContext.LogicToPixel(aSize);
1384 
1385  if (aSize.Width())
1386  {
1387  aSize.setWidth( aSize.Width() * 72 );
1388  aSize.AdjustWidth(mpWindowImpl->mpFrameData->mnDPIX / 2 );
1389  aSize.setWidth( aSize.Width() / ( mpWindowImpl->mpFrameData->mnDPIX) );
1390  }
1391  aSize.setHeight( aSize.Height() * 72 );
1392  aSize.AdjustHeight(mpWindowImpl->mpFrameData->mnDPIY / 2 );
1393  aSize.setHeight( aSize.Height() / ( mpWindowImpl->mpFrameData->mnDPIY) );
1394 
1395  rFont.SetFontSize(aSize);
1396 }
1397 
1399 {
1400  bool bSysChild = false;
1401 
1402  if ( ImplIsOverlapWindow() )
1403  {
1404  mnOutOffX = mpWindowImpl->mnX;
1405  mnOutOffY = mpWindowImpl->mnY;
1406  }
1407  else
1408  {
1409  vcl::Window* pParent = ImplGetParent();
1410 
1411  mnOutOffX = mpWindowImpl->mnX + pParent->mnOutOffX;
1412  mnOutOffY = mpWindowImpl->mnY + pParent->mnOutOffY;
1413  }
1414 
1415  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
1416  while ( pChild )
1417  {
1418  if ( pChild->ImplUpdatePos() )
1419  bSysChild = true;
1420  pChild = pChild->mpWindowImpl->mpNext;
1421  }
1422 
1423  if ( mpWindowImpl->mpSysObj )
1424  bSysChild = true;
1425 
1426  return bSysChild;
1427 }
1428 
1430 {
1431  if ( mpWindowImpl->mpSysObj )
1432  mpWindowImpl->mpSysObj->SetPosSize( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight );
1433 
1434  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
1435  while ( pChild )
1436  {
1437  pChild->ImplUpdateSysObjPos();
1438  pChild = pChild->mpWindowImpl->mpNext;
1439  }
1440 }
1441 
1442 void Window::ImplPosSizeWindow( long nX, long nY,
1443  long nWidth, long nHeight, PosSizeFlags nFlags )
1444 {
1445  bool bNewPos = false;
1446  bool bNewSize = false;
1447  bool bCopyBits = false;
1448  long nOldOutOffX = mnOutOffX;
1449  long nOldOutOffY = mnOutOffY;
1450  long nOldOutWidth = mnOutWidth;
1451  long nOldOutHeight = mnOutHeight;
1452  std::unique_ptr<vcl::Region> pOverlapRegion;
1453  std::unique_ptr<vcl::Region> pOldRegion;
1454 
1455  if ( IsReallyVisible() )
1456  {
1457  tools::Rectangle aOldWinRect( Point( nOldOutOffX, nOldOutOffY ),
1458  Size( nOldOutWidth, nOldOutHeight ) );
1459  pOldRegion.reset( new vcl::Region( aOldWinRect ) );
1460  if ( mpWindowImpl->mbWinRegion )
1461  pOldRegion->Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
1462 
1463  if ( mnOutWidth && mnOutHeight && !mpWindowImpl->mbPaintTransparent &&
1464  !mpWindowImpl->mbInitWinClipRegion && !mpWindowImpl->maWinClipRegion.IsEmpty() &&
1465  !HasPaintEvent() )
1466  bCopyBits = true;
1467  }
1468 
1469  bool bnXRecycled = false; // avoid duplicate mirroring in RTL case
1470  if ( nFlags & PosSizeFlags::Width )
1471  {
1472  if(!( nFlags & PosSizeFlags::X ))
1473  {
1474  nX = mpWindowImpl->mnX;
1475  nFlags |= PosSizeFlags::X;
1476  bnXRecycled = true; // we're using a mnX which was already mirrored in RTL case
1477  }
1478 
1479  if ( nWidth < 0 )
1480  nWidth = 0;
1481  if ( nWidth != mnOutWidth )
1482  {
1483  mnOutWidth = nWidth;
1484  bNewSize = true;
1485  bCopyBits = false;
1486  }
1487  }
1488  if ( nFlags & PosSizeFlags::Height )
1489  {
1490  if ( nHeight < 0 )
1491  nHeight = 0;
1492  if ( nHeight != mnOutHeight )
1493  {
1494  mnOutHeight = nHeight;
1495  bNewSize = true;
1496  bCopyBits = false;
1497  }
1498  }
1499 
1500  if ( nFlags & PosSizeFlags::X )
1501  {
1502  long nOrgX = nX;
1503  Point aPtDev( Point( nX+mnOutOffX, 0 ) );
1504  OutputDevice *pOutDev = GetOutDev();
1505  if( pOutDev->HasMirroredGraphics() )
1506  {
1507  aPtDev.setX( mpGraphics->mirror2( aPtDev.X(), this ) );
1508 
1509  // #106948# always mirror our pos if our parent is not mirroring, even
1510  // if we are also not mirroring
1511  // RTL: check if parent is in different coordinates
1512  if( !bnXRecycled && mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->ImplIsAntiparallel() )
1513  {
1514  nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
1515  }
1516  /* #i99166# An LTR window in RTL UI that gets sized only would be
1517  expected to not moved its upper left point
1518  */
1519  if( bnXRecycled )
1520  {
1521  if( ImplIsAntiparallel() )
1522  {
1523  aPtDev.setX( mpWindowImpl->mnAbsScreenX );
1524  nOrgX = mpWindowImpl->maPos.X();
1525  }
1526  }
1527  }
1528  else if( !bnXRecycled && mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->ImplIsAntiparallel() )
1529  {
1530  // mirrored window in LTR UI
1531  nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
1532  }
1533 
1534  // check maPos as well, as it could have been changed for client windows (ImplCallMove())
1535  if ( mpWindowImpl->mnAbsScreenX != aPtDev.X() || nX != mpWindowImpl->mnX || nOrgX != mpWindowImpl->maPos.X() )
1536  {
1537  if ( bCopyBits && !pOverlapRegion )
1538  {
1539  pOverlapRegion.reset( new vcl::Region() );
1541  Size( mnOutWidth, mnOutHeight ) ),
1542  *pOverlapRegion, false, true );
1543  }
1544  mpWindowImpl->mnX = nX;
1545  mpWindowImpl->maPos.setX( nOrgX );
1546  mpWindowImpl->mnAbsScreenX = aPtDev.X();
1547  bNewPos = true;
1548  }
1549  }
1550  if ( nFlags & PosSizeFlags::Y )
1551  {
1552  // check maPos as well, as it could have been changed for client windows (ImplCallMove())
1553  if ( nY != mpWindowImpl->mnY || nY != mpWindowImpl->maPos.Y() )
1554  {
1555  if ( bCopyBits && !pOverlapRegion )
1556  {
1557  pOverlapRegion.reset( new vcl::Region() );
1559  Size( mnOutWidth, mnOutHeight ) ),
1560  *pOverlapRegion, false, true );
1561  }
1562  mpWindowImpl->mnY = nY;
1563  mpWindowImpl->maPos.setY( nY );
1564  bNewPos = true;
1565  }
1566  }
1567 
1568  if ( bNewPos || bNewSize )
1569  {
1570  bool bUpdateSysObjPos = false;
1571  if ( bNewPos )
1572  bUpdateSysObjPos = ImplUpdatePos();
1573 
1574  // the borderwindow always specifies the position for its client window
1575  if ( mpWindowImpl->mpBorderWindow )
1576  mpWindowImpl->maPos = mpWindowImpl->mpBorderWindow->mpWindowImpl->maPos;
1577 
1578  if ( mpWindowImpl->mpClientWindow )
1579  {
1580  mpWindowImpl->mpClientWindow->ImplPosSizeWindow( mpWindowImpl->mpClientWindow->mpWindowImpl->mnLeftBorder,
1581  mpWindowImpl->mpClientWindow->mpWindowImpl->mnTopBorder,
1582  mnOutWidth-mpWindowImpl->mpClientWindow->mpWindowImpl->mnLeftBorder-mpWindowImpl->mpClientWindow->mpWindowImpl->mnRightBorder,
1583  mnOutHeight-mpWindowImpl->mpClientWindow->mpWindowImpl->mnTopBorder-mpWindowImpl->mpClientWindow->mpWindowImpl->mnBottomBorder,
1584  PosSizeFlags::X | PosSizeFlags::Y |
1585  PosSizeFlags::Width | PosSizeFlags::Height );
1586  // If we have a client window, then this is the position
1587  // of the Application's floating windows
1588  mpWindowImpl->mpClientWindow->mpWindowImpl->maPos = mpWindowImpl->maPos;
1589  if ( bNewPos )
1590  {
1591  if ( mpWindowImpl->mpClientWindow->IsVisible() )
1592  {
1593  mpWindowImpl->mpClientWindow->ImplCallMove();
1594  }
1595  else
1596  {
1597  mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = true;
1598  }
1599  }
1600  }
1601 
1602  // Move()/Resize() will be called only for Show(), such that
1603  // at least one is called before Show()
1604  if ( IsVisible() )
1605  {
1606  if ( bNewPos )
1607  {
1608  ImplCallMove();
1609  }
1610  if ( bNewSize )
1611  {
1612  ImplCallResize();
1613  }
1614  }
1615  else
1616  {
1617  if ( bNewPos )
1618  mpWindowImpl->mbCallMove = true;
1619  if ( bNewSize )
1620  mpWindowImpl->mbCallResize = true;
1621  }
1622 
1623  bool bUpdateSysObjClip = false;
1624  if ( IsReallyVisible() )
1625  {
1626  if ( bNewPos || bNewSize )
1627  {
1628  // set Clip-Flag
1629  bUpdateSysObjClip = !ImplSetClipFlag( true );
1630  }
1631 
1632  // invalidate window content ?
1633  if ( bNewPos || (mnOutWidth > nOldOutWidth) || (mnOutHeight > nOldOutHeight) )
1634  {
1635  if ( bNewPos )
1636  {
1637  bool bInvalidate = false;
1638  bool bParentPaint = true;
1639  if ( !ImplIsOverlapWindow() )
1640  bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled();
1641  if ( bCopyBits && bParentPaint && !HasPaintEvent() )
1642  {
1643  Point aPoint( mnOutOffX, mnOutOffY );
1644  vcl::Region aRegion( tools::Rectangle( aPoint,
1645  Size( mnOutWidth, mnOutHeight ) ) );
1646  if ( mpWindowImpl->mbWinRegion )
1647  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
1648  ImplClipBoundaries( aRegion, false, true );
1649  if ( !pOverlapRegion->IsEmpty() )
1650  {
1651  pOverlapRegion->Move( mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY );
1652  aRegion.Exclude( *pOverlapRegion );
1653  }
1654  if ( !aRegion.IsEmpty() )
1655  {
1656  // adapt Paint areas
1657  ImplMoveAllInvalidateRegions( tools::Rectangle( Point( nOldOutOffX, nOldOutOffY ),
1658  Size( nOldOutWidth, nOldOutHeight ) ),
1659  mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY,
1660  true );
1661  SalGraphics* pGraphics = ImplGetFrameGraphics();
1662  if ( pGraphics )
1663  {
1664 
1665  OutputDevice *pOutDev = GetOutDev();
1666  const bool bSelectClipRegion = pOutDev->SelectClipRegion( aRegion, pGraphics );
1667  if ( bSelectClipRegion )
1668  {
1669  pGraphics->CopyArea( mnOutOffX, mnOutOffY,
1670  nOldOutOffX, nOldOutOffY,
1671  nOldOutWidth, nOldOutHeight,
1672  this );
1673  }
1674  else
1675  bInvalidate = true;
1676  }
1677  else
1678  bInvalidate = true;
1679  if ( !bInvalidate )
1680  {
1681  if ( !pOverlapRegion->IsEmpty() )
1682  ImplInvalidateFrameRegion( pOverlapRegion.get(), InvalidateFlags::Children );
1683  }
1684  }
1685  else
1686  bInvalidate = true;
1687  }
1688  else
1689  bInvalidate = true;
1690  if ( bInvalidate )
1692  }
1693  else
1694  {
1695  Point aPoint( mnOutOffX, mnOutOffY );
1696  vcl::Region aRegion( tools::Rectangle( aPoint,
1697  Size( mnOutWidth, mnOutHeight ) ) );
1698  aRegion.Exclude( *pOldRegion );
1699  if ( mpWindowImpl->mbWinRegion )
1700  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
1701  ImplClipBoundaries( aRegion, false, true );
1702  if ( !aRegion.IsEmpty() )
1704  }
1705  }
1706 
1707  // invalidate Parent or Overlaps
1708  if ( bNewPos ||
1709  (mnOutWidth < nOldOutWidth) || (mnOutHeight < nOldOutHeight) )
1710  {
1711  vcl::Region aRegion( *pOldRegion );
1712  if ( !mpWindowImpl->mbPaintTransparent )
1713  ImplExcludeWindowRegion( aRegion );
1714  ImplClipBoundaries( aRegion, false, true );
1715  if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow )
1717  }
1718  }
1719 
1720  // adapt system objects
1721  if ( bUpdateSysObjClip )
1723  if ( bUpdateSysObjPos )
1725  if ( bNewSize && mpWindowImpl->mpSysObj )
1726  mpWindowImpl->mpSysObj->SetPosSize( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight );
1727  }
1728 }
1729 
1731 {
1732  ImplSVData* pSVData = ImplGetSVData();
1733  vcl::Window* pFocusWin = pSVData->mpWinData->mpFocusWin;
1734  if ( !pFocusWin || pFocusWin->IsDisposed() )
1735  return;
1736 
1737  // Is InputContext changed?
1738  const InputContext& rInputContext = pFocusWin->GetInputContext();
1739  if ( rInputContext == pFocusWin->mpWindowImpl->mpFrameData->maOldInputContext )
1740  return;
1741 
1742  pFocusWin->mpWindowImpl->mpFrameData->maOldInputContext = rInputContext;
1743 
1744  SalInputContext aNewContext;
1745  const vcl::Font& rFont = rInputContext.GetFont();
1746  const OUString& rFontName = rFont.GetFamilyName();
1748  aNewContext.mpFont = nullptr;
1749  if (!rFontName.isEmpty())
1750  {
1751  OutputDevice *pFocusWinOutDev = pFocusWin->GetOutDev();
1752  Size aSize = pFocusWinOutDev->ImplLogicToDevicePixel( rFont.GetFontSize() );
1753  if ( !aSize.Height() )
1754  {
1755  // only set default sizes if the font height in logical
1756  // coordinates equals 0
1757  if ( rFont.GetFontSize().Height() )
1758  aSize.setHeight( 1 );
1759  else
1760  aSize.setHeight( (12*pFocusWin->mnDPIY)/72 );
1761  }
1762  pFontInstance = pFocusWin->mxFontCache->GetFontInstance( pFocusWin->mxFontCollection.get(),
1763  rFont, aSize, static_cast<float>(aSize.Height()) );
1764  if ( pFontInstance )
1765  aNewContext.mpFont = pFontInstance;
1766  }
1767  aNewContext.mnOptions = rInputContext.GetOptions();
1768  pFocusWin->ImplGetFrame()->SetInputContext( &aNewContext );
1769 }
1770 
1772 {
1773  if (mpWindowImpl) // may be called after dispose
1774  {
1775  mpWindowImpl->maDumpAsPropertyTreeHdl = rLink;
1776  }
1777 }
1778 
1780 {
1782 }
1783 
1785 {
1786  Show(false);
1788 }
1789 
1791 {
1792  return mpWindowImpl->mpFrame->GetIndicatorState();
1793 }
1794 
1795 void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const
1796 {
1797  mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
1798 }
1799 
1800 void Window::KeyInput( const KeyEvent& rKEvt )
1801 {
1802  KeyCode cod = rKEvt.GetKeyCode ();
1803  bool autoacc = ImplGetSVData()->maNWFData.mbAutoAccel;
1804 
1805  // do not respond to accelerators unless Alt or Ctrl is held */
1806  if (cod.GetCode () >= 0x200 && cod.GetCode () <= 0x219)
1807  {
1808  if (autoacc && cod.GetModifier () != KEY_MOD2 && !(cod.GetModifier() & KEY_MOD1))
1809  return;
1810  }
1811 
1812  NotifyEvent aNEvt( MouseNotifyEvent::KEYINPUT, this, &rKEvt );
1813  if ( !CompatNotify( aNEvt ) )
1814  mpWindowImpl->mbKeyInput = true;
1815 }
1816 
1817 void Window::KeyUp( const KeyEvent& rKEvt )
1818 {
1819  NotifyEvent aNEvt( MouseNotifyEvent::KEYUP, this, &rKEvt );
1820  if ( !CompatNotify( aNEvt ) )
1821  mpWindowImpl->mbKeyUp = true;
1822 }
1823 
1824 void Window::Draw( OutputDevice*, const Point&, DrawFlags )
1825 {
1826 }
1827 
1828 void Window::Move() {}
1829 
1831 
1833 
1835 
1837 {
1838  if ( HasFocus() && mpWindowImpl->mpLastFocusWindow && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
1839  {
1840  VclPtr<vcl::Window> xWindow(this);
1841  mpWindowImpl->mpLastFocusWindow->GrabFocus();
1842  if( xWindow->IsDisposed() )
1843  return;
1844  }
1845 
1846  NotifyEvent aNEvt( MouseNotifyEvent::GETFOCUS, this );
1847  CompatNotify( aNEvt );
1848 }
1849 
1851 {
1853  CompatNotify( aNEvt );
1854 }
1855 
1857 {
1858  if (mpWindowImpl) // may be called after dispose
1859  {
1860  mpWindowImpl->maHelpRequestHdl = rLink;
1861  }
1862 }
1863 
1864 void Window::RequestHelp( const HelpEvent& rHEvt )
1865 {
1866  // if Balloon-Help is requested, show the balloon
1867  // with help text set
1868  if ( rHEvt.GetMode() & HelpEventMode::BALLOON )
1869  {
1870  OUString rStr = GetHelpText();
1871  if ( rStr.isEmpty() )
1872  rStr = GetQuickHelpText();
1873  if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() )
1874  ImplGetParent()->RequestHelp( rHEvt );
1875  else
1876  {
1877  Point aPos = GetPosPixel();
1878  if ( ImplGetParent() && !ImplIsOverlapWindow() )
1879  aPos = OutputToScreenPixel(Point(0, 0));
1880  tools::Rectangle aRect( aPos, GetSizePixel() );
1881 
1882  Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aRect, rStr );
1883  }
1884  }
1885  else if ( rHEvt.GetMode() & HelpEventMode::QUICK )
1886  {
1887  const OUString& rStr = GetQuickHelpText();
1888  if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() )
1889  ImplGetParent()->RequestHelp( rHEvt );
1890  else
1891  {
1892  Point aPos = GetPosPixel();
1893  if ( ImplGetParent() && !ImplIsOverlapWindow() )
1894  aPos = OutputToScreenPixel(Point(0, 0));
1895  tools::Rectangle aRect( aPos, GetSizePixel() );
1896  Help::ShowQuickHelp( this, aRect, rStr, QuickHelpFlags::CtrlText );
1897  }
1898  }
1899  else if (!mpWindowImpl->maHelpRequestHdl.IsSet() || mpWindowImpl->maHelpRequestHdl.Call(*this))
1900  {
1901  OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
1902  if ( aStrHelpId.isEmpty() && ImplGetParent() )
1903  ImplGetParent()->RequestHelp( rHEvt );
1904  else
1905  {
1906  Help* pHelp = Application::GetHelp();
1907  if ( pHelp )
1908  {
1909  if( !aStrHelpId.isEmpty() )
1910  pHelp->Start( aStrHelpId, this );
1911  else
1912  pHelp->Start( OOO_HELP_INDEX, this );
1913  }
1914  }
1915  }
1916 }
1917 
1918 void Window::Command( const CommandEvent& rCEvt )
1919 {
1920  CallEventListeners( VclEventId::WindowCommand, const_cast<CommandEvent *>(&rCEvt) );
1921 
1922  NotifyEvent aNEvt( MouseNotifyEvent::COMMAND, this, &rCEvt );
1923  if ( !CompatNotify( aNEvt ) )
1924  mpWindowImpl->mbCommand = true;
1925 }
1926 
1927 void Window::Tracking( const TrackingEvent& rTEvt )
1928 {
1929 
1931  if( pWrapper )
1932  pWrapper->Tracking( rTEvt );
1933 }
1934 
1936 {
1937  switch (eType)
1938  {
1939  //stuff that doesn't invalidate the layout
1949  break;
1950  //stuff that does invalidate the layout
1951  default:
1952  queue_resize(eType);
1953  break;
1954  }
1955 }
1956 
1958 {
1959  if ( mpWindowImpl && mpWindowImpl->mnStyle != nStyle )
1960  {
1961  mpWindowImpl->mnPrevStyle = mpWindowImpl->mnStyle;
1962  mpWindowImpl->mnStyle = nStyle;
1964  }
1965 }
1966 
1968 {
1969 
1970  if ( mpWindowImpl->mnExtendedStyle != nExtendedStyle )
1971  {
1972  vcl::Window* pWindow = ImplGetBorderWindow();
1973  if( ! pWindow )
1974  pWindow = this;
1975  if( pWindow->mpWindowImpl->mbFrame )
1976  {
1977  SalExtStyle nExt = 0;
1978  if( nExtendedStyle & WindowExtendedStyle::Document )
1980  if( nExtendedStyle & WindowExtendedStyle::DocModified )
1982 
1983  pWindow->ImplGetFrame()->SetExtendedFrameStyle( nExt );
1984  }
1985  mpWindowImpl->mnExtendedStyle = nExtendedStyle;
1986  }
1987 }
1988 
1990 {
1991 
1992  if ( mpWindowImpl->mpBorderWindow )
1993  {
1994  if( nBorderStyle == WindowBorderStyle::REMOVEBORDER &&
1995  ! mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame &&
1996  mpWindowImpl->mpBorderWindow->mpWindowImpl->mpParent
1997  )
1998  {
1999  // this is a little awkward: some controls (e.g. svtools ProgressBar)
2000  // cannot avoid getting constructed with WB_BORDER but want to disable
2001  // borders in case of NWF drawing. So they need a method to remove their border window
2002  VclPtr<vcl::Window> pBorderWin = mpWindowImpl->mpBorderWindow;
2003  // remove us as border window's client
2004  pBorderWin->mpWindowImpl->mpClientWindow = nullptr;
2005  mpWindowImpl->mpBorderWindow = nullptr;
2006  mpWindowImpl->mpRealParent = pBorderWin->mpWindowImpl->mpParent;
2007  // reparent us above the border window
2008  SetParent( pBorderWin->mpWindowImpl->mpParent );
2009  // set us to the position and size of our previous border
2010  Point aBorderPos( pBorderWin->GetPosPixel() );
2011  Size aBorderSize( pBorderWin->GetSizePixel() );
2012  setPosSizePixel( aBorderPos.X(), aBorderPos.Y(), aBorderSize.Width(), aBorderSize.Height() );
2013  // release border window
2014  pBorderWin.disposeAndClear();
2015 
2016  // set new style bits
2017  SetStyle( GetStyle() & (~WB_BORDER) );
2018  }
2019  else
2020  {
2021  if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW )
2022  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetBorderStyle( nBorderStyle );
2023  else
2024  mpWindowImpl->mpBorderWindow->SetBorderStyle( nBorderStyle );
2025  }
2026  }
2027 }
2028 
2030 {
2031 
2032  if ( mpWindowImpl->mpBorderWindow )
2033  {
2034  if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW )
2035  return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetBorderStyle();
2036  else
2037  return mpWindowImpl->mpBorderWindow->GetBorderStyle();
2038  }
2039 
2040  return WindowBorderStyle::NONE;
2041 }
2042 
2044 {
2045 
2046  if ( mpWindowImpl->mpBorderWindow )
2047  {
2048  if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW )
2049  return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CalcTitleWidth();
2050  else
2051  return mpWindowImpl->mpBorderWindow->CalcTitleWidth();
2052  }
2053  else if ( mpWindowImpl->mbFrame && (mpWindowImpl->mnStyle & WB_MOVEABLE) )
2054  {
2055  // we guess the width for frame windows as we do not know the
2056  // border of external dialogs
2057  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
2058  vcl::Font aFont = GetFont();
2059  const_cast<vcl::Window*>(this)->SetPointFont(*const_cast<Window*>(this), rStyleSettings.GetTitleFont());
2060  long nTitleWidth = GetTextWidth( GetText() );
2061  const_cast<vcl::Window*>(this)->SetFont( aFont );
2062  nTitleWidth += rStyleSettings.GetTitleHeight() * 3;
2063  nTitleWidth += StyleSettings::GetBorderSize() * 2;
2064  nTitleWidth += 10;
2065  return nTitleWidth;
2066  }
2067 
2068  return 0;
2069 }
2070 
2071 void Window::SetInputContext( const InputContext& rInputContext )
2072 {
2073 
2074  mpWindowImpl->maInputContext = rInputContext;
2075  if ( !mpWindowImpl->mbInFocusHdl && HasFocus() )
2077 }
2078 
2079 void Window::PostExtTextInputEvent(VclEventId nType, const OUString& rText)
2080 {
2081  switch (nType)
2082  {
2084  {
2085  std::unique_ptr<ExtTextInputAttr[]> pAttr(new ExtTextInputAttr[rText.getLength()]);
2086  for (int i = 0; i < rText.getLength(); ++i) {
2087  pAttr[i] = ExtTextInputAttr::Underline;
2088  }
2089  SalExtTextInputEvent aEvent { rText, pAttr.get(), rText.getLength(), EXTTEXTINPUT_CURSOR_OVERWRITE };
2091  }
2092  break;
2095  break;
2096  default:
2097  assert(false);
2098  }
2099 }
2100 
2102 {
2103  if ( mpWindowImpl->mbExtTextInput )
2105 }
2106 
2107 void Window::SetCursorRect( const tools::Rectangle* pRect, long nExtTextInputWidth )
2108 {
2109 
2110  ImplWinData* pWinData = ImplGetWinData();
2111  if ( pWinData->mpCursorRect )
2112  {
2113  if ( pRect )
2114  pWinData->mpCursorRect = *pRect;
2115  else
2116  pWinData->mpCursorRect.reset();
2117  }
2118  else
2119  {
2120  if ( pRect )
2121  pWinData->mpCursorRect = *pRect;
2122  }
2123 
2124  pWinData->mnCursorExtWidth = nExtTextInputWidth;
2125 
2126 }
2127 
2129 {
2130 
2131  ImplWinData* pWinData = ImplGetWinData();
2132  return pWinData->mpCursorRect ? &*pWinData->mpCursorRect : nullptr;
2133 }
2134 
2136 {
2137 
2138  ImplWinData* pWinData = ImplGetWinData();
2139  return pWinData->mnCursorExtWidth;
2140 }
2141 
2142 void Window::SetCompositionCharRect( const tools::Rectangle* pRect, long nCompositionLength, bool bVertical ) {
2143 
2144  ImplWinData* pWinData = ImplGetWinData();
2145  pWinData->mpCompositionCharRects.reset();
2146  pWinData->mbVertical = bVertical;
2147  pWinData->mnCompositionCharRects = nCompositionLength;
2148  if ( pRect && (nCompositionLength > 0) )
2149  {
2150  pWinData->mpCompositionCharRects.reset( new tools::Rectangle[nCompositionLength] );
2151  for (long i = 0; i < nCompositionLength; ++i)
2152  pWinData->mpCompositionCharRects[i] = pRect[i];
2153  }
2154 }
2155 
2156 void Window::CollectChildren(::std::vector<vcl::Window *>& rAllChildren )
2157 {
2158  rAllChildren.push_back( this );
2159 
2160  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2161  while ( pChild )
2162  {
2163  pChild->CollectChildren( rAllChildren );
2164  pChild = pChild->mpWindowImpl->mpNext;
2165  }
2166 }
2167 
2168 void Window::SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont)
2169 {
2170  vcl::Font aFont = rFont;
2171  ImplPointToLogic(rRenderContext, aFont);
2172  rRenderContext.SetFont(aFont);
2173 }
2174 
2176 {
2177  vcl::Font aFont = rRenderContext.GetFont();
2178  ImplLogicToPoint(rRenderContext, aFont);
2179  return aFont;
2180 }
2181 
2182 void Window::Show(bool bVisible, ShowFlags nFlags)
2183 {
2184  if ( IsDisposed() || mpWindowImpl->mbVisible == bVisible )
2185  return;
2186 
2187  VclPtr<vcl::Window> xWindow(this);
2188 
2189  bool bRealVisibilityChanged = false;
2190  mpWindowImpl->mbVisible = bVisible;
2191 
2192  if ( !bVisible )
2193  {
2195  if( xWindow->IsDisposed() )
2196  return;
2197 
2198  if ( mpWindowImpl->mpBorderWindow )
2199  {
2200  bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
2201  if ( mpWindowImpl->mbNoParentUpdate )
2202  mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = true;
2203  mpWindowImpl->mpBorderWindow->Show( false, nFlags );
2204  mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
2205  }
2206  else if ( mpWindowImpl->mbFrame )
2207  {
2208  mpWindowImpl->mbSuppressAccessibilityEvents = true;
2209  mpWindowImpl->mpFrame->Show( false );
2210  }
2211 
2213 
2214  if ( mpWindowImpl->mbReallyVisible )
2215  {
2216  if ( mpWindowImpl->mbInitWinClipRegion )
2218 
2219  vcl::Region aInvRegion = mpWindowImpl->maWinClipRegion;
2220 
2221  if( xWindow->IsDisposed() )
2222  return;
2223 
2224  bRealVisibilityChanged = mpWindowImpl->mbReallyVisible;
2226  ImplSetClipFlag();
2227 
2228  if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame )
2229  {
2230  // convert focus
2231  if ( !(nFlags & ShowFlags::NoFocusChange) && HasChildPathFocus() )
2232  {
2233  if ( mpWindowImpl->mpOverlapWindow->IsEnabled() &&
2234  mpWindowImpl->mpOverlapWindow->IsInputEnabled() &&
2235  ! mpWindowImpl->mpOverlapWindow->IsInModalMode()
2236  )
2237  mpWindowImpl->mpOverlapWindow->GrabFocus();
2238  }
2239  }
2240 
2241  if ( !mpWindowImpl->mbFrame )
2242  {
2243  if (mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mbEnableNativeWidget)
2244  {
2245  /*
2246  * #i48371# native theming: some themes draw outside the control
2247  * area we tell them to (bad thing, but we cannot do much about it ).
2248  * On hiding these controls they get invalidated with their window rectangle
2249  * which leads to the parts outside the control area being left and not
2250  * invalidated. Workaround: invalidate an area on the parent, too
2251  */
2252  const int workaround_border = 5;
2253  tools::Rectangle aBounds( aInvRegion.GetBoundRect() );
2254  aBounds.AdjustLeft( -workaround_border );
2255  aBounds.AdjustTop( -workaround_border );
2256  aBounds.AdjustRight(workaround_border );
2257  aBounds.AdjustBottom(workaround_border );
2258  aInvRegion = aBounds;
2259  }
2260  if ( !mpWindowImpl->mbNoParentUpdate )
2261  {
2262  if ( !aInvRegion.IsEmpty() )
2263  ImplInvalidateParentFrameRegion( aInvRegion );
2264  }
2266  }
2267  }
2268  }
2269  else
2270  {
2271  // inherit native widget flag for form controls
2272  // required here, because frames never show up in the child hierarchy - which should be fixed...
2273  // eg, the drop down of a combobox which is a system floating window
2274  if( mpWindowImpl->mbFrame && GetParent() && GetParent()->IsCompoundControl() &&
2276  !(GetStyle() & WB_TOOLTIPWIN) )
2277  {
2279  }
2280 
2281  if ( mpWindowImpl->mbCallMove )
2282  {
2283  ImplCallMove();
2284  }
2285  if ( mpWindowImpl->mbCallResize )
2286  {
2287  ImplCallResize();
2288  }
2289 
2291 
2292  vcl::Window* pTestParent;
2293  if ( ImplIsOverlapWindow() )
2294  pTestParent = mpWindowImpl->mpOverlapWindow;
2295  else
2296  pTestParent = ImplGetParent();
2297  if ( mpWindowImpl->mbFrame || pTestParent->mpWindowImpl->mbReallyVisible )
2298  {
2299  // if a window becomes visible, send all child windows a StateChange,
2300  // such that these can initialise themselves
2301  ImplCallInitShow();
2302 
2303  // If it is a SystemWindow it automatically pops up on top of
2304  // all other windows if needed.
2305  if ( ImplIsOverlapWindow() && !(nFlags & ShowFlags::NoActivate) )
2306  {
2308  ImplFocusToTop( ToTopFlags::NONE, false );
2309  }
2310 
2311  // adjust mpWindowImpl->mbReallyVisible
2312  bRealVisibilityChanged = !mpWindowImpl->mbReallyVisible;
2314 
2315  // assure clip rectangles will be recalculated
2316  ImplSetClipFlag();
2317 
2318  if ( !mpWindowImpl->mbFrame )
2319  {
2320  InvalidateFlags nInvalidateFlags = InvalidateFlags::Children;
2321  if( ! IsPaintTransparent() )
2322  nInvalidateFlags |= InvalidateFlags::NoTransparent;
2323  ImplInvalidate( nullptr, nInvalidateFlags );
2325  }
2326  }
2327 
2328  if ( mpWindowImpl->mpBorderWindow )
2329  mpWindowImpl->mpBorderWindow->Show( true, nFlags );
2330  else if ( mpWindowImpl->mbFrame )
2331  {
2332  // #106431#, hide SplashScreen
2333  ImplSVData* pSVData = ImplGetSVData();
2334  if ( !pSVData->mpIntroWindow )
2335  {
2336  // The right way would be just to call this (not even in the 'if')
2337  auto pApp = GetpApp();
2338  if ( pApp )
2339  pApp->InitFinished();
2340  }
2341  else if ( !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
2342  {
2343  // ... but the VCL splash is broken, and it needs this
2344  // (for ./soffice .uno:NewDoc)
2345  pSVData->mpIntroWindow->Hide();
2346  }
2347 
2348  //SAL_WARN_IF( mpWindowImpl->mbSuppressAccessibilityEvents, "vcl", "Window::Show() - Frame reactivated");
2349  mpWindowImpl->mbSuppressAccessibilityEvents = false;
2350 
2351  mpWindowImpl->mbPaintFrame = true;
2353  {
2354  bool bNoActivate(nFlags & (ShowFlags::NoActivate|ShowFlags::NoFocusChange));
2355  mpWindowImpl->mpFrame->Show( true, bNoActivate );
2356  }
2357  if( xWindow->IsDisposed() )
2358  return;
2359 
2360  // Query the correct size of the window, if we are waiting for
2361  // a system resize
2362  if ( mpWindowImpl->mbWaitSystemResize )
2363  {
2364  long nOutWidth;
2365  long nOutHeight;
2366  mpWindowImpl->mpFrame->GetClientSize( nOutWidth, nOutHeight );
2367  ImplHandleResize( this, nOutWidth, nOutHeight );
2368  }
2369 
2370  if (mpWindowImpl->mpFrameData->mpBuffer && mpWindowImpl->mpFrameData->mpBuffer->GetOutputSizePixel() != GetOutputSizePixel())
2371  // Make sure that the buffer size matches the window size, even if no resize was needed.
2372  mpWindowImpl->mpFrameData->mpBuffer->SetOutputSizePixel(GetOutputSizePixel());
2373  }
2374 
2375  if( xWindow->IsDisposed() )
2376  return;
2377 
2379  }
2380 
2381  if( xWindow->IsDisposed() )
2382  return;
2383 
2384  // the SHOW/HIDE events also serve as indicators to send child creation/destroy events to the access bridge
2385  // However, the access bridge only uses this event if the data member is not NULL (it's kind of a hack that
2386  // we re-use the SHOW/HIDE events this way, with this particular semantics).
2387  // Since #104887#, the notifications for the access bridge are done in Impl(Set|Reset)ReallyVisible. Here, we
2388  // now only notify with a NULL data pointer, for all other clients except the access bridge.
2389  if ( !bRealVisibilityChanged )
2391  if( xWindow->IsDisposed() )
2392  return;
2393 
2394 }
2395 
2397 {
2398  if (!mpWindowImpl)
2399  {
2400  SAL_WARN("vcl.layout", "WTF no windowimpl");
2401  return Size(0,0);
2402  }
2403 
2404  // #i43257# trigger pending resize handler to assure correct window sizes
2405  if( mpWindowImpl->mpFrameData->maResizeIdle.IsActive() )
2406  {
2407  VclPtr<vcl::Window> xWindow( const_cast<Window*>(this) );
2408  mpWindowImpl->mpFrameData->maResizeIdle.Stop();
2409  mpWindowImpl->mpFrameData->maResizeIdle.Invoke( nullptr );
2410  if( xWindow->IsDisposed() )
2411  return Size(0,0);
2412  }
2413 
2414  return Size( mnOutWidth+mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder,
2415  mnOutHeight+mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder );
2416 }
2417 
2418 void Window::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
2419  sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
2420 {
2421  rLeftBorder = mpWindowImpl->mnLeftBorder;
2422  rTopBorder = mpWindowImpl->mnTopBorder;
2423  rRightBorder = mpWindowImpl->mnRightBorder;
2424  rBottomBorder = mpWindowImpl->mnBottomBorder;
2425 }
2426 
2427 void Window::Enable( bool bEnable, bool bChild )
2428 {
2429  if ( IsDisposed() )
2430  return;
2431 
2432  if ( !bEnable )
2433  {
2434  // the tracking mode will be stopped or the capture will be stolen
2435  // when a window is disabled,
2436  if ( IsTracking() )
2438  if ( IsMouseCaptured() )
2439  ReleaseMouse();
2440  // try to pass focus to the next control
2441  // if the window has focus and is contained in the dialog control
2442  // mpWindowImpl->mbDisabled should only be set after a call of ImplDlgCtrlNextWindow().
2443  // Otherwise ImplDlgCtrlNextWindow() should be used
2444  if ( HasFocus() )
2446  }
2447 
2448  if ( mpWindowImpl->mpBorderWindow )
2449  {
2450  mpWindowImpl->mpBorderWindow->Enable( bEnable, false );
2451  if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) &&
2452  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow )
2453  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->Enable( bEnable );
2454  }
2455 
2456  // #i56102# restore app focus win in case the
2457  // window was disabled when the frame focus changed
2458  ImplSVData* pSVData = ImplGetSVData();
2459  if (bEnable && pSVData->mpWinData->mpFocusWin == nullptr
2460  && mpWindowImpl->mpFrameData->mbHasFocus && mpWindowImpl->mpFrameData->mpFocusWin == this)
2461  pSVData->mpWinData->mpFocusWin = this;
2462 
2463  if ( mpWindowImpl->mbDisabled != !bEnable )
2464  {
2465  mpWindowImpl->mbDisabled = !bEnable;
2466  if ( mpWindowImpl->mpSysObj )
2467  mpWindowImpl->mpSysObj->Enable( bEnable && !mpWindowImpl->mbInputDisabled );
2469 
2471  }
2472 
2473  if ( bChild )
2474  {
2475  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2476  while ( pChild )
2477  {
2478  pChild->Enable( bEnable, bChild );
2479  pChild = pChild->mpWindowImpl->mpNext;
2480  }
2481  }
2482 
2483  if ( IsReallyVisible() )
2485 }
2486 
2488 {
2489  mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall;
2490 
2491  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2492  while ( pChild )
2493  {
2494  pChild->SetCallHandlersOnInputDisabled( bCall );
2495  pChild = pChild->mpWindowImpl->mpNext;
2496  }
2497 }
2498 
2500 {
2501  return mpWindowImpl->mbCallHandlersDuringInputDisabled;
2502 }
2503 
2504 void Window::EnableInput( bool bEnable, bool bChild )
2505 {
2506  if (!mpWindowImpl)
2507  return;
2508 
2509  bool bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
2510  if ( mpWindowImpl->mpBorderWindow )
2511  {
2512  mpWindowImpl->mpBorderWindow->EnableInput( bEnable, false );
2513  if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) &&
2514  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow )
2515  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->EnableInput( bEnable );
2516  }
2517 
2518  if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) ||
2519  ( bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled) )
2520  {
2521  // automatically stop the tracking mode or steal capture
2522  // if the window is disabled
2523  if ( !bEnable )
2524  {
2525  if ( IsTracking() )
2527  if ( IsMouseCaptured() )
2528  ReleaseMouse();
2529  }
2530 
2531  if ( mpWindowImpl->mbInputDisabled != !bEnable )
2532  {
2533  mpWindowImpl->mbInputDisabled = !bEnable;
2534  if ( mpWindowImpl->mpSysObj )
2535  mpWindowImpl->mpSysObj->Enable( !mpWindowImpl->mbDisabled && bEnable );
2536  }
2537  }
2538 
2539  // #i56102# restore app focus win in case the
2540  // window was disabled when the frame focus changed
2541  ImplSVData* pSVData = ImplGetSVData();
2542  if (bEnable && pSVData->mpWinData->mpFocusWin == nullptr
2543  && mpWindowImpl->mpFrameData->mbHasFocus && mpWindowImpl->mpFrameData->mpFocusWin == this)
2544  pSVData->mpWinData->mpFocusWin = this;
2545 
2546  if ( bChild )
2547  {
2548  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2549  while ( pChild )
2550  {
2551  pChild->EnableInput( bEnable, bChild );
2552  pChild = pChild->mpWindowImpl->mpNext;
2553  }
2554  }
2555 
2556  if ( IsReallyVisible() )
2558 
2559  // #104827# notify parent
2560  if ( bNotify && bEnable )
2561  {
2563  CompatNotify( aNEvt );
2564  }
2565 }
2566 
2567 void Window::EnableInput( bool bEnable, const vcl::Window* pExcludeWindow )
2568 {
2569  if (!mpWindowImpl)
2570  return;
2571 
2572  EnableInput( bEnable );
2573 
2574  // pExecuteWindow is the first Overlap-Frame --> if this
2575  // shouldn't be the case, then this must be changed in dialog.cxx
2576  if( pExcludeWindow )
2577  pExcludeWindow = pExcludeWindow->ImplGetFirstOverlapWindow();
2578  vcl::Window* pSysWin = mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mpFirstOverlap;
2579  while ( pSysWin )
2580  {
2581  // Is Window in the path from this window
2582  if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, true ) )
2583  {
2584  // Is Window not in the exclude window path or not the
2585  // exclude window, then change the status
2586  if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, true ) )
2587  pSysWin->EnableInput( bEnable );
2588  }
2589  pSysWin = pSysWin->mpWindowImpl->mpNextOverlap;
2590  }
2591 
2592  // enable/disable floating system windows as well
2594  while ( pFrameWin )
2595  {
2596  if( pFrameWin->ImplIsFloatingWindow() )
2597  {
2598  // Is Window in the path from this window
2599  if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, true ) )
2600  {
2601  // Is Window not in the exclude window path or not the
2602  // exclude window, then change the status
2603  if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, true ) )
2604  pFrameWin->EnableInput( bEnable );
2605  }
2606  }
2607  pFrameWin = pFrameWin->mpWindowImpl->mpFrameData->mpNextFrame;
2608  }
2609 
2610  // the same for ownerdraw floating windows
2611  if( mpWindowImpl->mbFrame )
2612  {
2613  ::std::vector< VclPtr<vcl::Window> >& rList = mpWindowImpl->mpFrameData->maOwnerDrawList;
2614  for (auto const& elem : rList)
2615  {
2616  // Is Window in the path from this window
2617  if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( elem, true ) )
2618  {
2619  // Is Window not in the exclude window path or not the
2620  // exclude window, then change the status
2621  if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( elem, true ) )
2622  elem->EnableInput( bEnable );
2623  }
2624  }
2625  }
2626 }
2627 
2628 void Window::AlwaysEnableInput( bool bAlways, bool bChild )
2629 {
2630 
2631  if ( mpWindowImpl->mpBorderWindow )
2632  mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, false );
2633 
2634  if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled )
2635  {
2636  mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled;
2637  EnableInput(true, false);
2638  }
2639  else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled )
2640  {
2641  mpWindowImpl->meAlwaysInputMode = AlwaysInputNone;
2642  }
2643 
2644  if ( bChild )
2645  {
2646  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2647  while ( pChild )
2648  {
2649  pChild->AlwaysEnableInput( bAlways, bChild );
2650  pChild = pChild->mpWindowImpl->mpNext;
2651  }
2652  }
2653 }
2654 
2655 void Window::AlwaysDisableInput( bool bAlways, bool bChild )
2656 {
2657 
2658  if ( mpWindowImpl->mpBorderWindow )
2659  mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, false );
2660 
2661  if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled )
2662  {
2663  mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled;
2664  EnableInput(false, false);
2665  }
2666  else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled )
2667  {
2668  mpWindowImpl->meAlwaysInputMode = AlwaysInputNone;
2669  }
2670 
2671  if ( bChild )
2672  {
2673  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
2674  while ( pChild )
2675  {
2676  pChild->AlwaysDisableInput( bAlways, bChild );
2677  pChild = pChild->mpWindowImpl->mpNext;
2678  }
2679  }
2680 }
2681 
2683 {
2684 
2685  if ( mpWindowImpl->mpBorderWindow )
2686  mpWindowImpl->mpBorderWindow->SetActivateMode( nMode );
2687 
2688  if ( mpWindowImpl->mnActivateMode != nMode )
2689  {
2690  mpWindowImpl->mnActivateMode = nMode;
2691 
2692  // possibly trigger Deactivate/Activate
2693  if ( mpWindowImpl->mnActivateMode != ActivateModeFlags::NONE )
2694  {
2695  if ( (mpWindowImpl->mbActive || (GetType() == WindowType::BORDERWINDOW)) &&
2696  !HasChildPathFocus( true ) )
2697  {
2698  mpWindowImpl->mbActive = false;
2699  Deactivate();
2700  }
2701  }
2702  else
2703  {
2704  if ( !mpWindowImpl->mbActive || (GetType() == WindowType::BORDERWINDOW) )
2705  {
2706  mpWindowImpl->mbActive = true;
2707  Activate();
2708  }
2709  }
2710  }
2711 }
2712 
2713 void Window::setPosSizePixel( long nX, long nY,
2714  long nWidth, long nHeight, PosSizeFlags nFlags )
2715 {
2716  bool bHasValidSize = !mpWindowImpl->mbDefSize;
2717 
2718  if ( nFlags & PosSizeFlags::Pos )
2719  mpWindowImpl->mbDefPos = false;
2720  if ( nFlags & PosSizeFlags::Size )
2721  mpWindowImpl->mbDefSize = false;
2722 
2723  // The top BorderWindow is the window which is to be positioned
2724  VclPtr<vcl::Window> pWindow = this;
2725  while ( pWindow->mpWindowImpl->mpBorderWindow )
2726  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
2727 
2728  if ( pWindow->mpWindowImpl->mbFrame )
2729  {
2730  // Note: if we're positioning a frame, the coordinates are interpreted
2731  // as being the top-left corner of the window's client area and NOT
2732  // as the position of the border ! (due to limitations of several UNIX window managers)
2733  long nOldWidth = pWindow->mnOutWidth;
2734 
2735  if ( !(nFlags & PosSizeFlags::Width) )
2736  nWidth = pWindow->mnOutWidth;
2737  if ( !(nFlags & PosSizeFlags::Height) )
2738  nHeight = pWindow->mnOutHeight;
2739 
2740  sal_uInt16 nSysFlags=0;
2741  VclPtr<vcl::Window> pParent = GetParent();
2742  VclPtr<vcl::Window> pWinParent = pWindow->GetParent();
2743 
2744  if( nFlags & PosSizeFlags::Width )
2745  nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
2746  if( nFlags & PosSizeFlags::Height )
2747  nSysFlags |= SAL_FRAME_POSSIZE_HEIGHT;
2748  if( nFlags & PosSizeFlags::X )
2749  {
2750  nSysFlags |= SAL_FRAME_POSSIZE_X;
2751  if( pWinParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
2752  {
2753  nX += pWinParent->mnOutOffX;
2754  }
2755  if( pParent && pParent->ImplIsAntiparallel() )
2756  {
2757  tools::Rectangle aRect( Point ( nX, nY ), Size( nWidth, nHeight ) );
2758  const OutputDevice *pParentOutDev = pParent->GetOutDev();
2759  pParentOutDev->ReMirror( aRect );
2760  nX = aRect.Left();
2761  }
2762  }
2763  if( !(nFlags & PosSizeFlags::X) && bHasValidSize && pWindow->mpWindowImpl->mpFrame->maGeometry.nWidth )
2764  {
2765  // RTL: make sure the old right aligned position is not changed
2766  // system windows will always grow to the right
2767  if ( pWinParent )
2768  {
2769  OutputDevice *pParentOutDev = pWinParent->GetOutDev();
2770  if( pParentOutDev->HasMirroredGraphics() )
2771  {
2772  const SalFrameGeometry& aSysGeometry = mpWindowImpl->mpFrame->GetUnmirroredGeometry();
2773  const SalFrameGeometry& aParentSysGeometry =
2774  pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry();
2775  long myWidth = nOldWidth;
2776  if( !myWidth )
2777  myWidth = aSysGeometry.nWidth;
2778  if( !myWidth )
2779  myWidth = nWidth;
2780  nFlags |= PosSizeFlags::X;
2781  nSysFlags |= SAL_FRAME_POSSIZE_X;
2782  nX = aParentSysGeometry.nX - aSysGeometry.nLeftDecoration + aParentSysGeometry.nWidth
2783  - myWidth - 1 - aSysGeometry.nX;
2784  }
2785  }
2786  }
2787  if( nFlags & PosSizeFlags::Y )
2788  {
2789  nSysFlags |= SAL_FRAME_POSSIZE_Y;
2790  if( pWinParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
2791  {
2792  nY += pWinParent->mnOutOffY;
2793  }
2794  }
2795 
2797  {
2798  // check for min/max client size and adjust size accordingly
2799  // otherwise it may happen that the resize event is ignored, i.e. the old size remains
2800  // unchanged but ImplHandleResize() is called with the wrong size
2801  SystemWindow *pSystemWindow = dynamic_cast< SystemWindow* >( pWindow.get() );
2802  if( pSystemWindow )
2803  {
2804  Size aMinSize = pSystemWindow->GetMinOutputSizePixel();
2805  Size aMaxSize = pSystemWindow->GetMaxOutputSizePixel();
2806  if( nWidth < aMinSize.Width() )
2807  nWidth = aMinSize.Width();
2808  if( nHeight < aMinSize.Height() )
2809  nHeight = aMinSize.Height();
2810 
2811  if( nWidth > aMaxSize.Width() )
2812  nWidth = aMaxSize.Width();
2813  if( nHeight > aMaxSize.Height() )
2814  nHeight = aMaxSize.Height();
2815  }
2816  }
2817 
2818  pWindow->mpWindowImpl->mpFrame->SetPosSize( nX, nY, nWidth, nHeight, nSysFlags );
2819 
2820  // Adjust resize with the hack of different client size and frame geometries to fix
2821  // native menu bars. Eventually this should be replaced by proper mnTopBorder usage.
2822  pWindow->mpWindowImpl->mpFrame->GetClientSize(nWidth, nHeight);
2823 
2824  // Resize should be called directly. If we haven't
2825  // set the correct size, we get a second resize from
2826  // the system with the correct size. This can be happened
2827  // if the size is too small or too large.
2828  ImplHandleResize( pWindow, nWidth, nHeight );
2829  }
2830  else
2831  {
2832  pWindow->ImplPosSizeWindow( nX, nY, nWidth, nHeight, nFlags );
2833  if ( IsReallyVisible() )
2835  }
2836 }
2837 
2839 {
2840  return mpWindowImpl->maPos;
2841 }
2842 
2844 {
2845  tools::Rectangle rRect;
2846  mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrame->GetWorkArea( rRect );
2847  return rRect;
2848 }
2849 
2850 Point Window::OutputToScreenPixel( const Point& rPos ) const
2851 {
2852  // relative to top level parent
2853  return Point( rPos.X()+mnOutOffX, rPos.Y()+mnOutOffY );
2854 }
2855 
2856 Point Window::ScreenToOutputPixel( const Point& rPos ) const
2857 {
2858  // relative to top level parent
2859  return Point( rPos.X()-mnOutOffX, rPos.Y()-mnOutOffY );
2860 }
2861 
2863 {
2864  // revert mnOutOffX changes that were potentially made in ImplPosSizeWindow
2865  long offx = mnOutOffX;
2866  OutputDevice *pOutDev = GetOutDev();
2867  if( pOutDev->HasMirroredGraphics() )
2868  {
2869  if( mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->ImplIsAntiparallel() )
2870  {
2871  if ( !ImplIsOverlapWindow() )
2872  offx -= mpWindowImpl->mpParent->mnOutOffX;
2873 
2874  offx = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - offx;
2875 
2876  if ( !ImplIsOverlapWindow() )
2877  offx += mpWindowImpl->mpParent->mnOutOffX;
2878 
2879  }
2880  }
2881  return offx;
2882 }
2883 
2884 // normalized screen pixel are independent of mirroring
2886 {
2887  // relative to top level parent
2888  long offx = const_cast<vcl::Window*>(this)->ImplGetUnmirroredOutOffX();
2889  return Point( rPos.X()+offx, rPos.Y()+mnOutOffY );
2890 }
2891 
2893 {
2894  // relative to top level parent
2895  long offx = const_cast<vcl::Window*>(this)->ImplGetUnmirroredOutOffX();
2896  return Point( rPos.X()-offx, rPos.Y()-mnOutOffY );
2897 }
2898 
2899 Point Window::OutputToAbsoluteScreenPixel( const Point& rPos ) const
2900 {
2901  // relative to the screen
2902  Point p = OutputToScreenPixel( rPos );
2903  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
2904  p.AdjustX(g.nX );
2905  p.AdjustY(g.nY );
2906  return p;
2907 }
2908 
2909 Point Window::AbsoluteScreenToOutputPixel( const Point& rPos ) const
2910 {
2911  // relative to the screen
2912  Point p = ScreenToOutputPixel( rPos );
2913  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
2914  p.AdjustX( -(g.nX) );
2915  p.AdjustY( -(g.nY) );
2916  return p;
2917 }
2918 
2920 {
2921  // this method creates unmirrored screen coordinates to be compared with the desktop
2922  // and is used for positioning of RTL popup windows correctly on the screen
2923  SalFrameGeometry g = mpWindowImpl->mpFrame->GetUnmirroredGeometry();
2924 
2925  Point p1 = OutputToScreenPixel( rRect.TopRight() );
2926  p1.setX( g.nX+g.nWidth-p1.X() );
2927  p1.AdjustY(g.nY );
2928 
2929  Point p2 = OutputToScreenPixel( rRect.BottomLeft() );
2930  p2.setX( g.nX+g.nWidth-p2.X() );
2931  p2.AdjustY(g.nY );
2932 
2933  return tools::Rectangle( p1, p2 );
2934 }
2935 
2937 {
2938  // with decoration
2939  return ImplGetWindowExtentsRelative( pRelativeWindow );
2940 }
2941 
2943 {
2944  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
2945  // make sure we use the extent of our border window,
2946  // otherwise we miss a few pixels
2947  const vcl::Window *pWin = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow : this;
2948 
2949  Point aPos( pWin->OutputToScreenPixel( Point(0,0) ) );
2950  aPos.AdjustX(g.nX );
2951  aPos.AdjustY(g.nY );
2952  Size aSize ( pWin->GetSizePixel() );
2953  // #104088# do not add decoration to the workwindow to be compatible to java accessibility api
2954  if( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && GetType() != WindowType::WORKWINDOW) )
2955  {
2956  aPos.AdjustX( -sal_Int32(g.nLeftDecoration) );
2957  aPos.AdjustY( -sal_Int32(g.nTopDecoration) );
2959  aSize.AdjustHeight(g.nTopDecoration + g.nBottomDecoration );
2960  }
2961  if( pRelativeWindow )
2962  {
2963  // #106399# express coordinates relative to borderwindow
2964  vcl::Window *pRelWin = pRelativeWindow->mpWindowImpl->mpBorderWindow ? pRelativeWindow->mpWindowImpl->mpBorderWindow.get() : pRelativeWindow;
2965  aPos = pRelWin->AbsoluteScreenToOutputPixel( aPos );
2966  }
2967  return tools::Rectangle( aPos, aSize );
2968 }
2969 
2970 void Window::Scroll( long nHorzScroll, long nVertScroll, ScrollFlags nFlags )
2971 {
2972 
2974  Size( mnOutWidth, mnOutHeight ) ),
2975  nHorzScroll, nVertScroll, nFlags & ~ScrollFlags::Clip );
2976 }
2977 
2978 void Window::Scroll( long nHorzScroll, long nVertScroll,
2979  const tools::Rectangle& rRect, ScrollFlags nFlags )
2980 {
2981  OutputDevice *pOutDev = GetOutDev();
2982  tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
2984  if ( !aRect.IsEmpty() )
2985  ImplScroll( aRect, nHorzScroll, nVertScroll, nFlags );
2986 }
2987 
2989 {
2990  if (mpWindowImpl)
2991  {
2993  mpWindowImpl->mpFrame->Flush( aWinRect );
2994  }
2995 }
2996 
2997 void Window::SetUpdateMode( bool bUpdate )
2998 {
2999  if (mpWindowImpl)
3000  {
3001  mpWindowImpl->mbNoUpdate = !bUpdate;
3003  }
3004 }
3005 
3007 {
3009 }
3010 
3011 bool Window::HasFocus() const
3012 {
3013  return (this == ImplGetSVData()->mpWinData->mpFocusWin);
3014 }
3015 
3017 {
3019 }
3020 
3022 {
3023  if (mpWindowImpl && mpWindowImpl->mpFrameData)
3024  return mpWindowImpl->mpFrameData->mpFocusWin;
3025  else
3026  return VclPtr<vcl::Window>();
3027 }
3028 
3029 void Window::SetFakeFocus( bool bFocus )
3030 {
3031  ImplGetWindowImpl()->mbFakeFocusSet = bFocus;
3032 }
3033 
3034 bool Window::HasChildPathFocus( bool bSystemWindow ) const
3035 {
3036 
3037  vcl::Window* pFocusWin = ImplGetSVData()->mpWinData->mpFocusWin;
3038  if ( pFocusWin )
3039  return ImplIsWindowOrChild( pFocusWin, bSystemWindow );
3040  return false;
3041 }
3042 
3044 {
3045 
3046  if ( mpWindowImpl->mpCursor != pCursor )
3047  {
3048  if ( mpWindowImpl->mpCursor )
3049  mpWindowImpl->mpCursor->ImplHide();
3050  mpWindowImpl->mpCursor = pCursor;
3051  if ( pCursor )
3052  pCursor->ImplShow();
3053  }
3054 }
3055 
3056 void Window::SetText( const OUString& rStr )
3057 {
3058  if (!mpWindowImpl || rStr == mpWindowImpl->maText)
3059  return;
3060 
3061  OUString oldTitle( mpWindowImpl->maText );
3062  mpWindowImpl->maText = rStr;
3063 
3064  if ( mpWindowImpl->mpBorderWindow )
3065  mpWindowImpl->mpBorderWindow->SetText( rStr );
3066  else if ( mpWindowImpl->mbFrame )
3067  mpWindowImpl->mpFrame->SetTitle( rStr );
3068 
3070 
3071  // #107247# needed for accessibility
3072  // The VclEventId::WindowFrameTitleChanged is (mis)used to notify accessible name changes.
3073  // Therefore a window, which is labeled by this window, must also notify an accessible
3074  // name change.
3075  if ( IsReallyVisible() )
3076  {
3078  if ( pWindow && pWindow != this )
3080  }
3081 
3083 }
3084 
3085 OUString Window::GetText() const
3086 {
3087 
3088  return mpWindowImpl->maText;
3089 }
3090 
3091 OUString Window::GetDisplayText() const
3092 {
3093 
3094  return GetText();
3095 }
3096 
3098 {
3099  // FIXME: fix issue 52349, need to fix this really in
3100  // all NWF enabled controls
3101  const ToolBox* pTB = dynamic_cast<const ToolBox*>(this);
3102  if( pTB && IsNativeWidgetEnabled() )
3104 
3105  if( !IsBackground() )
3106  {
3107  if( mpWindowImpl->mpParent )
3108  return mpWindowImpl->mpParent->GetDisplayBackground();
3109  }
3110 
3111  const Wallpaper& rBack = GetBackground();
3112  if( ! rBack.IsBitmap() &&
3113  ! rBack.IsGradient() &&
3114  rBack.GetColor()== COL_TRANSPARENT &&
3115  mpWindowImpl->mpParent )
3116  return mpWindowImpl->mpParent->GetDisplayBackground();
3117  return rBack;
3118 }
3119 
3120 const OUString& Window::GetHelpText() const
3121 {
3122  OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
3123  bool bStrHelpId = !aStrHelpId.isEmpty();
3124 
3125  if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId )
3126  {
3127  if ( !IsDialog() && (mpWindowImpl->mnType != WindowType::TABPAGE) && (mpWindowImpl->mnType != WindowType::FLOATINGWINDOW) )
3128  {
3129  Help* pHelp = Application::GetHelp();
3130  if ( pHelp )
3131  {
3132  mpWindowImpl->maHelpText = pHelp->GetHelpText(aStrHelpId, this);
3133  mpWindowImpl->mbHelpTextDynamic = false;
3134  }
3135  }
3136  }
3137  else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
3138  {
3139  static const char* pEnv = getenv( "HELP_DEBUG" );
3140  if( pEnv && *pEnv )
3141  {
3142  OUString aTxt = mpWindowImpl->maHelpText + "\n------------------\n" + aStrHelpId;
3143  mpWindowImpl->maHelpText = aTxt;
3144  }
3145  mpWindowImpl->mbHelpTextDynamic = false;
3146  }
3147 
3148  //Fallback to Window::GetAccessibleDescription without reentry to GetHelpText()
3149  if (mpWindowImpl->maHelpText.isEmpty() && mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleDescription)
3150  return *mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
3151  return mpWindowImpl->maHelpText;
3152 }
3153 
3154 void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow )
3155 {
3156  if (!mpWindowImpl)
3157  return;
3158 
3159  // be safe against re-entrance: first clear the old ref, then assign the new one
3160  mpWindowImpl->mxWindowPeer.clear();
3161  mpWindowImpl->mxWindowPeer = xPeer;
3162 
3163  mpWindowImpl->mpVCLXWindow = pVCLXWindow;
3164 }
3165 
3166 Reference< css::awt::XWindowPeer > Window::GetComponentInterface( bool bCreate )
3167 {
3168  if ( !mpWindowImpl->mxWindowPeer.is() && bCreate )
3169  {
3170  UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
3171  if ( pWrapper )
3172  mpWindowImpl->mxWindowPeer = pWrapper->GetWindowInterface( this );
3173  }
3174  return mpWindowImpl->mxWindowPeer;
3175 }
3176 
3177 void Window::SetComponentInterface( Reference< css::awt::XWindowPeer > const & xIFace )
3178 {
3179  UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
3180  SAL_WARN_IF( !pWrapper, "vcl.window", "SetComponentInterface: No Wrapper!" );
3181  if ( pWrapper )
3182  pWrapper->SetWindowInterface( this, xIFace );
3183 }
3184 
3185 typedef std::map<vcl::LOKWindowId, VclPtr<vcl::Window>> LOKWindowsMap;
3186 
3187 namespace {
3188 
3189 LOKWindowsMap& GetLOKWindowsMap()
3190 {
3191  // Map to remember the LOKWindowId <-> Window binding.
3192  static LOKWindowsMap s_aLOKWindowsMap;
3193 
3194  return s_aLOKWindowsMap;
3195 }
3196 
3197 }
3198 
3199 void Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent)
3200 {
3201  // don't allow setting this twice
3202  assert(mpWindowImpl->mpLOKNotifier == nullptr);
3203  assert(pNotifier);
3204  // never use this in the desktop case
3206 
3207  if (!bParent)
3208  {
3209  // Counter to be able to have unique id's for each window.
3210  static vcl::LOKWindowId sLastLOKWindowId = 1;
3211 
3212  // assign the LOK window id
3213  assert(mpWindowImpl->mnLOKWindowId == 0);
3214  mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++;
3215  GetLOKWindowsMap().emplace(mpWindowImpl->mnLOKWindowId, this);
3216  }
3217  else
3218  mpWindowImpl->mbLOKParentNotifier = true;
3219 
3220  mpWindowImpl->mpLOKNotifier = pNotifier;
3221 }
3222 
3224 {
3225  const auto it = GetLOKWindowsMap().find(nWindowId);
3226  if (it != GetLOKWindowsMap().end())
3227  return it->second;
3228 
3229  return VclPtr<Window>();
3230 }
3231 
3233 {
3234  return GetLOKWindowsMap().empty();
3235 }
3236 
3238 {
3239  // unregister the LOK window binding
3240  if (mpWindowImpl->mnLOKWindowId > 0)
3241  GetLOKWindowsMap().erase(mpWindowImpl->mnLOKWindowId);
3242 
3243  mpWindowImpl->mpLOKNotifier = nullptr;
3244  mpWindowImpl->mnLOKWindowId = 0;
3245 }
3246 
3247 ILibreOfficeKitNotifier::~ILibreOfficeKitNotifier()
3248 {
3250  {
3251  return;
3252  }
3253 
3254  for (auto it = GetLOKWindowsMap().begin(); it != GetLOKWindowsMap().end();)
3255  {
3256  WindowImpl* pWindowImpl = it->second->ImplGetWindowImpl();
3257  if (pWindowImpl && pWindowImpl->mpLOKNotifier == this)
3258  {
3259  pWindowImpl->mpLOKNotifier = nullptr;
3260  pWindowImpl->mnLOKWindowId = 0;
3261  it = GetLOKWindowsMap().erase(it);
3262  continue;
3263  }
3264 
3265  ++it;
3266  }
3267 }
3268 
3269 const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const
3270 {
3271  return mpWindowImpl->mpLOKNotifier;
3272 }
3273 
3275 {
3276  return mpWindowImpl->mnLOKWindowId;
3277 }
3278 
3280 {
3281  VclPtr<vcl::Window> pWindow(this);
3282 
3283  while (pWindow && !pWindow->GetLOKNotifier())
3284  pWindow = pWindow->GetParent();
3285 
3286  return pWindow;
3287 }
3288 
3289 namespace
3290 {
3291 
3292 const char* windowTypeName(WindowType nWindowType)
3293 {
3294  switch (nWindowType)
3295  {
3296  case WindowType::NONE: return "none";
3297  case WindowType::MESSBOX: return "messagebox";
3298  case WindowType::INFOBOX: return "infobox";
3299  case WindowType::WARNINGBOX: return "warningbox";
3300  case WindowType::ERRORBOX: return "errorbox";
3301  case WindowType::QUERYBOX: return "querybox";
3302  case WindowType::WINDOW: return "window";
3303  case WindowType::WORKWINDOW: return "workwindow";
3304  case WindowType::CONTAINER: return "container";
3305  case WindowType::FLOATINGWINDOW: return "floatingwindow";
3306  case WindowType::DIALOG: return "dialog";
3307  case WindowType::MODELESSDIALOG: return "modelessdialog";
3308  case WindowType::CONTROL: return "control";
3309  case WindowType::PUSHBUTTON: return "pushbutton";
3310  case WindowType::OKBUTTON: return "okbutton";
3311  case WindowType::CANCELBUTTON: return "cancelbutton";
3312  case WindowType::HELPBUTTON: return "helpbutton";
3313  case WindowType::IMAGEBUTTON: return "imagebutton";
3314  case WindowType::MENUBUTTON: return "menubutton";
3315  case WindowType::MOREBUTTON: return "morebutton";
3316  case WindowType::SPINBUTTON: return "spinbutton";
3317  case WindowType::RADIOBUTTON: return "radiobutton";
3318  case WindowType::CHECKBOX: return "checkbox";
3319  case WindowType::TRISTATEBOX: return "tristatebox";
3320  case WindowType::EDIT: return "edit";
3321  case WindowType::MULTILINEEDIT: return "multilineedit";
3322  case WindowType::COMBOBOX: return "combobox";
3323  case WindowType::LISTBOX: return "listbox";
3324  case WindowType::MULTILISTBOX: return "multilistbox";
3325  case WindowType::FIXEDTEXT: return "fixedtext";
3326  case WindowType::FIXEDLINE: return "fixedline";
3327  case WindowType::FIXEDBITMAP: return "fixedbitmap";
3328  case WindowType::FIXEDIMAGE: return "fixedimage";
3329  case WindowType::GROUPBOX: return "groupbox";
3330  case WindowType::SCROLLBAR: return "scrollbar";
3331  case WindowType::SCROLLBARBOX: return "scrollbarbox";
3332  case WindowType::SPLITTER: return "splitter";
3333  case WindowType::SPLITWINDOW: return "splitwindow";
3334  case WindowType::SPINFIELD: return "spinfield";
3335  case WindowType::PATTERNFIELD: return "patternfield";
3336  case WindowType::METRICFIELD: return "metricfield";
3337  case WindowType::FORMATTEDFIELD: return "formattedfield";
3338  case WindowType::CURRENCYFIELD: return "currencyfield";
3339  case WindowType::DATEFIELD: return "datefield";
3340  case WindowType::TIMEFIELD: return "timefield";
3341  case WindowType::PATTERNBOX: return "patternbox";
3342  case WindowType::NUMERICBOX: return "numericbox";
3343  case WindowType::METRICBOX: return "metricbox";
3344  case WindowType::CURRENCYBOX: return "currencybox";
3345  case WindowType::DATEBOX: return "datebox";
3346  case WindowType::TIMEBOX: return "timebox";
3347  case WindowType::LONGCURRENCYBOX: return "longcurrencybox";
3348  case WindowType::SCROLLWINDOW: return "scrollwindow";
3349  case WindowType::TOOLBOX: return "toolbox";
3350  case WindowType::DOCKINGWINDOW: return "dockingwindow";
3351  case WindowType::STATUSBAR: return "statusbar";
3352  case WindowType::TABPAGE: return "tabpage";
3353  case WindowType::TABCONTROL: return "tabcontrol";
3354  case WindowType::TABDIALOG: return "tabdialog";
3355  case WindowType::BORDERWINDOW: return "borderwindow";
3356  case WindowType::BUTTONDIALOG: return "buttondialog";
3357  case WindowType::SYSTEMCHILDWINDOW: return "systemchildwindow";
3358  case WindowType::SLIDER: return "slider";
3359  case WindowType::MENUBARWINDOW: return "menubarwindow";
3360  case WindowType::TREELISTBOX: return "treelistbox";
3361  case WindowType::HELPTEXTWINDOW: return "helptextwindow";
3362  case WindowType::INTROWINDOW: return "introwindow";
3363  case WindowType::LISTBOXWINDOW: return "listboxwindow";
3364  case WindowType::DOCKINGAREA: return "dockingarea";
3365  case WindowType::RULER: return "ruler";
3366  case WindowType::CALCINPUTLINE: return "calcinputline";
3367  case WindowType::HEADERBAR: return "headerbar";
3368  case WindowType::VERTICALTABCONTROL: return "verticaltabcontrol";
3369 
3370  // nothing to do here, but for completeness
3371  case WindowType::TOOLKIT_FRAMEWINDOW: return "toolkit_framewindow";
3372  case WindowType::TOOLKIT_SYSTEMCHILDWINDOW: return "toolkit_systemchildwindow";
3373  }
3374 
3375  return "none";
3376 }
3377 
3378 }
3379 
3381 {
3382  rJsonWriter.put("id", get_id()); // TODO could be missing - sort out
3383  rJsonWriter.put("type", windowTypeName(GetType()));
3384  rJsonWriter.put("text", GetText());
3385  rJsonWriter.put("enabled", IsEnabled());
3386 
3387  if (vcl::Window* pChild = mpWindowImpl->mpFirstChild)
3388  {
3389  auto childrenNode = rJsonWriter.startNode("children");
3390  while (pChild)
3391  {
3392  if (pChild->IsVisible()) {
3393  auto childNode = rJsonWriter.startNode("");
3394  pChild->DumpAsPropertyTree(rJsonWriter);
3395  sal_Int32 nLeft = pChild->get_grid_left_attach();
3396  sal_Int32 nTop = pChild->get_grid_top_attach();
3397  if (nLeft != -1 && nTop != -1)
3398  {
3399  rJsonWriter.put("left", nLeft);
3400  rJsonWriter.put("top", nTop);
3401  }
3402  }
3403  pChild = pChild->mpWindowImpl->mpNext;
3404  }
3405  }
3406 
3407  mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);
3408 }
3409 
3411 {
3412  // no deactivation if the newly activated window is my child
3413  if ( !pNew || !ImplIsChild( pNew ) )
3414  {
3415  VclPtr<vcl::Window> xWindow(this);
3417  if( xWindow->IsDisposed() )
3418  return;
3419 
3420  // #100759#, avoid walking the wrong frame's hierarchy
3421  // eg, undocked docking windows (ImplDockFloatWin)
3422  if ( ImplGetParent() && mpWindowImpl->mpFrameWindow == ImplGetParent()->mpWindowImpl->mpFrameWindow )
3424  }
3425 }
3426 
3428 {
3429  // no activation if the old active window is my child
3430  if ( !pOld || !ImplIsChild( pOld ) )
3431  {
3432  VclPtr<vcl::Window> xWindow(this);
3434  if( xWindow->IsDisposed() )
3435  return;
3436 
3437  if ( ImplGetParent() )
3439  else if( (mpWindowImpl->mnStyle & WB_INTROWIN) == 0 )
3440  {
3441  // top level frame reached: store hint for DefModalDialogParent
3443  }
3444  }
3445 }
3446 
3447 void Window::SetClipboard(Reference<XClipboard> const & xClipboard)
3448 {
3449  if (mpWindowImpl->mpFrameData)
3450  mpWindowImpl->mpFrameData->mxClipboard = xClipboard;
3451 }
3452 
3453 Reference< XClipboard > Window::GetClipboard()
3454 {
3455  if (!mpWindowImpl->mpFrameData)
3456  return static_cast<XClipboard*>(nullptr);
3457  if (!mpWindowImpl->mpFrameData->mxClipboard.is())
3458  mpWindowImpl->mpFrameData->mxClipboard = GetSystemClipboard();
3459  return mpWindowImpl->mpFrameData->mxClipboard;
3460 }
3461 
3462 Reference< XClipboard > Window::GetPrimarySelection()
3463 {
3464  if (!mpWindowImpl->mpFrameData)
3465  return static_cast<XClipboard*>(nullptr);
3466  if (!mpWindowImpl->mpFrameData->mxSelection.is())
3467  mpWindowImpl->mpFrameData->mxSelection = GetSystemPrimarySelection();
3468  return mpWindowImpl->mpFrameData->mxSelection;
3469 }
3470 
3472 {
3474  mpOutDevData->mpRecordLayout = pLayout;
3475  mpOutDevData->maRecordRect = rRect;
3476  Paint(*this, rRect);
3477  mpOutDevData->mpRecordLayout = nullptr;
3478 }
3479 
3481  sal_uInt16 highlight,
3482  bool bChecked,
3483  bool bDrawBorder
3484  )
3485 {
3486  if( rRect.IsEmpty() )
3487  return;
3488 
3489  const StyleSettings& rStyles = GetSettings().GetStyleSettings();
3490 
3491  // colors used for item highlighting
3492  Color aSelectionBorderCol( rStyles.GetHighlightColor() );
3493  Color aSelectionFillCol( aSelectionBorderCol );
3494 
3495  bool bDark = rStyles.GetFaceColor().IsDark();
3496  bool bBright = ( rStyles.GetFaceColor() == COL_WHITE );
3497 
3498  int c1 = aSelectionBorderCol.GetLuminance();
3499  int c2 = GetBackgroundColor().GetLuminance();
3500 
3501  if( !bDark && !bBright && abs( c2-c1 ) < 75 )
3502  {
3503  // contrast too low
3504  sal_uInt16 h,s,b;
3505  aSelectionFillCol.RGBtoHSB( h, s, b );
3506  if( b > 50 ) b -= 40;
3507  else b += 40;
3508  aSelectionFillCol = Color::HSBtoRGB( h, s, b );
3509  aSelectionBorderCol = aSelectionFillCol;
3510  }
3511 
3512  tools::Rectangle aRect( rRect );
3513  Color oldFillCol = GetFillColor();
3514  Color oldLineCol = GetLineColor();
3515 
3516  if( bDrawBorder )
3517  SetLineColor( bDark ? COL_WHITE : ( bBright ? COL_BLACK : aSelectionBorderCol ) );
3518  else
3519  SetLineColor();
3520 
3521  sal_uInt16 nPercent = 0;
3522  if( !highlight )
3523  {
3524  if( bDark )
3525  aSelectionFillCol = COL_BLACK;
3526  else
3527  nPercent = 80; // just checked (light)
3528  }
3529  else
3530  {
3531  if( bChecked && highlight == 2 )
3532  {
3533  if( bDark )
3534  aSelectionFillCol = COL_LIGHTGRAY;
3535  else if ( bBright )
3536  {
3537  aSelectionFillCol = COL_BLACK;
3539  nPercent = 0;
3540  }
3541  else
3542  nPercent = 20; // selected, pressed or checked ( very dark )
3543  }
3544  else if( bChecked || highlight == 1 )
3545  {
3546  if( bDark )
3547  aSelectionFillCol = COL_GRAY;
3548  else if ( bBright )
3549  {
3550  aSelectionFillCol = COL_BLACK;
3552  nPercent = 0;
3553  }
3554  else
3555  nPercent = 35; // selected, pressed or checked ( very dark )
3556  }
3557  else
3558  {
3559  if( bDark )
3560  aSelectionFillCol = COL_LIGHTGRAY;
3561  else if ( bBright )
3562  {
3563  aSelectionFillCol = COL_BLACK;
3565  if( highlight == 3 )
3566  nPercent = 80;
3567  else
3568  nPercent = 0;
3569  }
3570  else
3571  nPercent = 70; // selected ( dark )
3572  }
3573  }
3574 
3575  SetFillColor( aSelectionFillCol );
3576 
3577  if( bDark )
3578  {
3579  DrawRect( aRect );
3580  }
3581  else
3582  {
3583  tools::Polygon aPoly( aRect );
3584  tools::PolyPolygon aPolyPoly( aPoly );
3585  DrawTransparent( aPolyPoly, nPercent );
3586  }
3587 
3588  SetFillColor( oldFillCol );
3589  SetLineColor( oldLineCol );
3590 }
3591 
3593 {
3594  // check for scrollbars
3595  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
3596  while( pChild )
3597  {
3598  if( pChild->GetType() == WindowType::SCROLLBAR )
3599  return true;
3600  else
3601  pChild = pChild->mpWindowImpl->mpNext;
3602  }
3603  return false;
3604 }
3605 
3606 void Window::ImplMirrorFramePos( Point &pt ) const
3607 {
3608  pt.setX( mpWindowImpl->mpFrame->maGeometry.nWidth-1-pt.X() );
3609 }
3610 
3611 // frame based modal counter (dialogs are not modal to the whole application anymore)
3613 {
3614  return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
3615 }
3616 
3618 {
3619  vcl::Window* pFrameWindow = mpWindowImpl->mpFrameWindow;
3620  vcl::Window* pParent = pFrameWindow;
3621  while( pFrameWindow )
3622  {
3623  pFrameWindow->mpWindowImpl->mpFrameData->mnModalMode++;
3624  while( pParent && pParent->mpWindowImpl->mpFrameWindow == pFrameWindow )
3625  {
3626  pParent = pParent->GetParent();
3627  }
3628  pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : nullptr;
3629  }
3630 }
3632 {
3633  vcl::Window* pFrameWindow = mpWindowImpl->mpFrameWindow;
3634  vcl::Window* pParent = pFrameWindow;
3635  while( pFrameWindow )
3636  {
3637  pFrameWindow->mpWindowImpl->mpFrameData->mnModalMode--;
3638  while( pParent && pParent->mpWindowImpl->mpFrameWindow == pFrameWindow )
3639  {
3640  pParent = pParent->GetParent();
3641  }
3642  pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : nullptr;
3643  }
3644 }
3645 
3646 void Window::ImplIsInTaskPaneList( bool mbIsInTaskList )
3647 {
3648  mpWindowImpl->mbIsInTaskPaneList = mbIsInTaskList;
3649 }
3650 
3651 void Window::ImplNotifyIconifiedState( bool bIconified )
3652 {
3653  mpWindowImpl->mpFrameWindow->CallEventListeners( bIconified ? VclEventId::WindowMinimize : VclEventId::WindowNormalize );
3654  // #109206# notify client window as well to have toolkit topwindow listeners notified
3655  if( mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow && mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow )
3656  mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->CallEventListeners( bIconified ? VclEventId::WindowMinimize : VclEventId::WindowNormalize );
3657 }
3658 
3660 {
3661  bool bRet = false;
3663  while( pFrameWin )
3664  {
3665  if( pFrameWin != mpWindowImpl->mpFrameWindow )
3666  {
3667  bool bDecorated = false;
3668  VclPtr< vcl::Window > pChildFrame = pFrameWin->ImplGetWindow();
3669  // #i15285# unfortunately WB_MOVEABLE is the same as WB_TABSTOP which can
3670  // be removed for ToolBoxes to influence the keyboard accessibility
3671  // thus WB_MOVEABLE is no indicator for decoration anymore
3672  // but FloatingWindows carry this information in their TitleType...
3673  // TODO: avoid duplicate WinBits !!!
3674  if( pChildFrame && pChildFrame->ImplIsFloatingWindow() )
3675  bDecorated = static_cast<FloatingWindow*>(pChildFrame.get())->GetTitleType() != FloatWinTitleType::NONE;
3676  if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
3677  if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
3678  {
3679  if( ImplIsChild( pChildFrame, true ) )
3680  {
3681  bRet = true;
3682  break;
3683  }
3684  }
3685  }
3686  pFrameWin = pFrameWin->mpWindowImpl->mpFrameData->mpNextFrame;
3687  }
3688  return bRet;
3689 }
3690 
3692 {
3693  return mpWindowImpl->mpFrame->GetInputLanguage();
3694 }
3695 
3696 void Window::EnableNativeWidget( bool bEnable )
3697 {
3698  static const char* pNoNWF = getenv( "SAL_NO_NWF" );
3699  if( pNoNWF && *pNoNWF )
3700  bEnable = false;
3701 
3702  if( bEnable != ImplGetWinData()->mbEnableNativeWidget )
3703  {
3704  ImplGetWinData()->mbEnableNativeWidget = bEnable;
3705 
3706  // send datachanged event to allow for internal changes required for NWF
3707  // like clipmode, transparency, etc.
3709  CompatDataChanged( aDCEvt );
3710 
3711  // sometimes the borderwindow is queried, so keep it in sync
3712  if( mpWindowImpl->mpBorderWindow )
3713  mpWindowImpl->mpBorderWindow->ImplGetWinData()->mbEnableNativeWidget = bEnable;
3714  }
3715 
3716  // push down, useful for compound controls
3717  VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
3718  while( pChild )
3719  {
3720  pChild->EnableNativeWidget( bEnable );
3721  pChild = pChild->mpWindowImpl->mpNext;
3722  }
3723 }
3724 
3726 {
3728 }
3729 
3730 Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas ) const
3731 {
3732  // try to retrieve hard reference from weak member
3733  Reference< css::rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
3734 
3735  // canvas still valid? Then we're done.
3736  if( xCanvas.is() )
3737  return xCanvas;
3738 
3739  Sequence< Any > aArg(5);
3740 
3741  // Feed any with operating system's window handle
3742 
3743  // common: first any is VCL pointer to window (for VCL canvas)
3744  aArg[ 0 ] <<= reinterpret_cast<sal_Int64>(this);
3745  aArg[ 1 ] <<= css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight );
3746  aArg[ 2 ] <<= mpWindowImpl->mbAlwaysOnTop;
3747  aArg[ 3 ] <<= Reference< css::awt::XWindow >(
3748  const_cast<vcl::Window*>(this)->GetComponentInterface(),
3749  UNO_QUERY );
3750  aArg[ 4 ] = GetSystemGfxDataAny();
3751 
3753 
3754  // Create canvas instance with window handle
3755 
3756  static vcl::DeleteUnoReferenceOnDeinit<XMultiComponentFactory> xStaticCanvasFactory(
3757  css::rendering::CanvasFactory::create( xContext ) );
3758  Reference<XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get());
3759 
3760  if(xCanvasFactory.is())
3761  {
3762 #ifdef _WIN32
3763  // see #140456# - if we're running on a multiscreen setup,
3764  // request special, multi-screen safe sprite canvas
3765  // implementation (not DX5 canvas, as it cannot cope with
3766  // surfaces spanning multiple displays). Note: canvas
3767  // (without sprite) stays the same)
3768  const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
3769  if( nDisplay >= Application::GetScreenCount() )
3770  {
3771  xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3772  bSpriteCanvas ?
3773  OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
3774  OUString( "com.sun.star.rendering.Canvas.MultiScreen" ),
3775  aArg,
3776  xContext ),
3777  UNO_QUERY );
3778 
3779  }
3780  else
3781 #endif
3782  {
3783  xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3784  bSpriteCanvas ?
3785  OUString( "com.sun.star.rendering.SpriteCanvas" ) :
3786  OUString( "com.sun.star.rendering.Canvas" ),
3787  aArg,
3788  xContext ),
3789  UNO_QUERY );
3790 
3791  }
3792  mpWindowImpl->mxCanvas = xCanvas;
3793  }
3794 
3795  // no factory??? Empty reference, then.
3796  return xCanvas;
3797 }
3798 
3799 Reference< css::rendering::XCanvas > Window::GetCanvas() const
3800 {
3801  return ImplGetCanvas( false );
3802 }
3803 
3804 Reference< css::rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
3805 {
3806  Reference< css::rendering::XSpriteCanvas > xSpriteCanvas(
3807  ImplGetCanvas( true ), UNO_QUERY );
3808  return xSpriteCanvas;
3809 }
3810 
3812 {
3813  return OUString();
3814 }
3815 
3817 {
3818  return Selection( 0, 0 );
3819 }
3820 
3822 {
3823  return meRasterOp != RasterOp::OverPaint;
3824 }
3825 
3827 {
3828 }
3829 
3831 {
3832 
3833  return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : nullptr;
3834 }
3835 
3837 {
3838  return mpWindowImpl->mpFrameData->mpBuffer;
3839 }
3840 
3842 {
3843  if (bRequest)
3844  {
3845  mpWindowImpl->mpFrameData->mpBuffer = VclPtrInstance<VirtualDevice>();
3846  // Make sure that the buffer size matches the frame size.
3847  mpWindowImpl->mpFrameData->mpBuffer->SetOutputSizePixel(mpWindowImpl->mpFrameWindow->GetOutputSizePixel());
3848  }
3849  else
3850  mpWindowImpl->mpFrameData->mpBuffer.reset();
3851 }
3852 
3853 /*
3854  * The rationale here is that we moved destructors to
3855  * dispose and this altered a lot of code paths, that
3856  * are better left unchanged for now.
3857  */
3858 #define COMPAT_BODY(method,args) \
3859  if (!mpWindowImpl || mpWindowImpl->mbInDispose) \
3860  Window::method args; \
3861  else \
3862  method args;
3863 
3865 {
3866  COMPAT_BODY(GetFocus,())
3867 }
3868 
3870 {
3872 }
3873 
3875 {
3876  COMPAT_BODY(StateChanged,(nStateChange))
3877 }
3878 
3880 {
3881  COMPAT_BODY(DataChanged,(rDCEvt))
3882 }
3883 
3885 {
3886  if (!mpWindowImpl || mpWindowImpl->mbInDispose)
3887  return Window::PreNotify( rNEvt );
3888  else
3889  return PreNotify( rNEvt );
3890 }
3891 
3893 {
3894  if (!mpWindowImpl || mpWindowImpl->mbInDispose)
3895  return Window::EventNotify( rNEvt );
3896  else
3897  return EventNotify( rNEvt );
3898 }
3899 
3900 void Window::set_id(const OUString& rID)
3901 {
3902  mpWindowImpl->maID = rID;
3903 }
3904 
3905 const OUString& Window::get_id() const
3906 {
3907  return mpWindowImpl->maID;
3908 }
3909 
3911 {
3912  return WindowUIObject::create;
3913 }
3914 
3915 } /* namespace vcl */
3916 
3917 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
Definition: window.cxx:2838
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:472
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3056
bool mbDlgCtrlStart
Definition: window.h:318
bool mbNeedSysWindow
Definition: window.h:163
long Width() const
void EndExtTextInput()
Definition: window.cxx:2101
long mnFirstMouseX
Definition: window.h:149
OutDevType GetOutDevType() const
Definition: outdev.hxx:524
#define SAL_FRAME_POSSIZE_HEIGHT
Definition: salframe.hxx:106
long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:340
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
Definition: outdev.hxx:347
long mnSrcWidth
Definition: salgtype.hxx:52
bool IsInputEnabled() const
Definition: window2.cxx:1127
WinBits const WB_APP
bool mbAlwaysOnTop
Definition: window.h:318
virtual void Move()
Definition: window.cxx:1828
virtual const Wallpaper & GetDisplayBackground() const
Definition: window.cxx:3097
WinBits const WB_NOSHADOW
MouseEventModifiers mnMouseMode
Definition: window.h:158
Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit template class makes sure that a static UNO...
Definition: lazydelete.hxx:95
SAL_DLLPRIVATE float approximate_char_width() const
Definition: text.cxx:908
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:316
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:835
void SetCompositionCharRect(const tools::Rectangle *pRect, long nCompositionLength, bool bVertical=false)
Definition: window.cxx:2142
unsigned long nWidth
Definition: salgeom.hxx:31
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
VclPtr< vcl::Window > GetFocusedWindow() const
Definition: window.cxx:3021
const Wallpaper & GetBackground() const
Definition: outdev.hxx:643
SAL_DLLPRIVATE SalGraphics * ImplGetFrameGraphics() const
Definition: window.cxx:1270
sal_Int32 mnPadding
Definition: window.h:308
#define SAL_FRAME_POSSIZE_Y
Definition: salframe.hxx:104
vcl::LOKWindowId GetLOKWindowId() const
Definition: window.cxx:3274
void remove_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:1958
void SimulateKeyPress(sal_uInt16 nKeyCode) const
Definition: window.cxx:1795
bool mbSplitter
Definition: window.h:318
void SetFontSize(const Size &)
Definition: font/font.cxx:117
bool mbHexpand
Definition: window.h:318
SAL_DLLPRIVATE bool ImplUpdatePos()
Definition: window.cxx:1398
SAL_DLLPRIVATE void ImplCallResize()
Definition: event.cxx:515
static VclPtr< vcl::Window > FindLOKWindow(vcl::LOKWindowId nWindowId)
Find an existing Window based on the LOKWindowId.
Definition: window.cxx:3223
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
virtual FactoryFunction GetUITestFactory() const
Definition: window.cxx:3910
VclPtr< vcl::Window > mpFocusWin
Definition: svdata.hxx:247
#define OOO_HELP_INDEX
Definition: help.hxx:53
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:911
sal_Int32 mnGridWidth
Definition: window.h:312
bool HasActiveChildFrame() const
Definition: window.cxx:3659
SAL_DLLPRIVATE void ImplIsInTaskPaneList(bool mbIsInTaskList)
Definition: window.cxx:3646
const OUString & GetFamilyName() const
Definition: font/font.cxx:670
constexpr sal_uInt16 KEY_MOD1
Definition: keycodes.hxx:31
bool mbVexpand
Definition: window.h:318
long mnSrcHeight
Definition: salgtype.hxx:53
bool mbInHideFocus
Definition: window.h:318
static long GetBorderSize()
virtual bool UsePolyPolygonForComplexGradient() override
Definition: window.cxx:3821
bool mbMouseButtonUp
Definition: window.h:318
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
DialogControlFlags mnDlgCtrlFlags
Definition: window.h:303
VclPackType mePackType
Definition: window.h:307
bool mbDefPos
Definition: window.h:318
vcl::Cursor * mpCursor
Definition: window.h:257
long mnY
Definition: window.h:274
long AdjustWidth(long n)
Point OutputToNormalizedScreenPixel(const Point &rPos) const
Definition: window.cxx:2885
#define LANGUAGE_ENGLISH_US
long GetTitleHeight() const
void AlwaysDisableInput(bool bAlways, bool bChild=true)
Override EnableInput, counterpart to AlwaysEnableInput.
Definition: window.cxx:2655
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
SAL_DLLPRIVATE::std::vector< VclPtr< vcl::Window > > & ImplGetOwnerDrawList()
Definition: window2.cxx:818
KeyIndicatorState GetIndicatorState() const
Query the states of keyboard indicators - Caps Lock, Num Lock and Scroll Lock.
Definition: window.cxx:1790
void CompatLoseFocus()
Definition: window.cxx:3869
void SetComponentInterface(css::uno::Reference< css::awt::XWindowPeer > const &xIFace)
Definition: window.cxx:3177
long mnBeforeLastMouseY
Definition: window.h:148
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate) override
Definition: window.cxx:1224
InvalidateFlags
Definition: window.hxx:212
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle)=0
long Height() const
long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:342
WindowExtendedStyle
Definition: window.hxx:443
#define SAL_FRAME_POSSIZE_WIDTH
Definition: salframe.hxx:105
void DecModalCount()
Definition: window.cxx:3631
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
Definition: window.cxx:3453
WinBits const WB_NODIALOGCONTROL
Definition: help.hxx:60
static Help * GetHelp()
Gets the application's help.
Definition: svapp.cxx:1353
static SAL_DLLPRIVATE void ImplInitAppFontData(vcl::Window const *pWindow)
Definition: window.cxx:1168
Point BottomLeft() const
sal_Int32 mnOptimalHeightCache
Definition: window.h:272
vcl::Window * GetAccessibleParentWindow() const
bool IsBackground() const
Definition: outdev.hxx:646
sal_uInt16 mnWaitCount
Definition: window.h:298
Resize runs before repaint, so we won't paint twice.
SAL_DLLPRIVATE void ImplInitResolutionSettings()
Definition: window.cxx:1328
long AdjustLeft(long nHorzMoveDelta)
ImplSVAppData maAppData
Definition: svdata.hxx:392
Wallpaper maDisplayBackground
Definition: toolbox.h:141
SAL_DLLPRIVATE void ImplUpdateSysObjPos()
Definition: window.cxx:1429
SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2909
unsigned long nLeftDecoration
Definition: salgeom.hxx:33
int mnEventListenersIteratingCount
Definition: window.h:245
bool mbInitChildRegion
Definition: window.h:318
void SetCallback(vcl::Window *pWindow, SALFRAMEPROC pProc)
Definition: salvtables.cxx:89
bool mbInBufferedPaint
PaintHelper is in the process of painting into this buffer.
Definition: window.h:179
void disposeAndClear()
Definition: vclptr.hxx:200
bool ImplWindowFrameProc(vcl::Window *_pWindow, SalEvent nEvent, const void *pEvent)
Definition: winproc.cxx:2349
bool mbVisible
Definition: window.h:318
bool mbNonHomogeneous
Definition: window.h:318
const StyleSettings & GetStyleSettings() const
sal_uInt8 GetLuminance() const
const Color & GetFaceColor() const
bool mbStartFocusState
Definition: window.h:165
bool mbClipSiblings
Definition: window.h:318
const OUString & GetHelpText() const
Definition: window.cxx:3120
bool IsMapModeEnabled() const
Definition: outdev.hxx:1673
void Flush() override
Definition: window.cxx:2988
ActivateModeFlags mnActivateMode
Definition: window.h:302
css::uno::Reference< I > get()
Definition: lazydelete.hxx:103
SAL_DLLPRIVATE css::uno::Reference< css::rendering::XCanvas > ImplGetCanvas(bool bSpriteCanvas) const
Definition: window.cxx:3730
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
Definition: mouse.cxx:195
ImplSVNWFData maNWFData
Definition: svdata.hxx:398
SAL_DLLPRIVATE void ImplCallMove()
Definition: event.cxx:539
const OUString & GetQuickHelpText() const
Definition: window2.cxx:1232
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:875
SAL_DLLPRIVATE void ImplCallInitShow()
Definition: event.cxx:490
sal_Int32 mnHeightRequest
Definition: window.h:270
std::unique_ptr< AllSettings > mpSettings
Definition: svdata.hxx:132
static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
Definition: window.cxx:915
SAL_DLLPRIVATE ImplToolBoxPrivateData * ImplGetToolBoxPrivateData() const
Definition: toolbox.hxx:250
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
Definition: window2.cxx:1968
std::unique_ptr< ImplAccessibleInfos > mpAccessibleInfos
Definition: window.h:286
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2396
sal_Int32 mnTopBorder
Definition: window.h:266
ScopedJsonWriterNode startNode(const char *)
bool CompatNotify(NotifyEvent &rNEvt)
Definition: window.cxx:3892
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
Definition: window.hxx:554
void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3874
void CopyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev)
#define SAL_FRAME_POSSIZE_X
Definition: salframe.hxx:103
void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier *pNotifier, bool bParent=false)
Interface to register for dialog / window tunneling.
Definition: window.cxx:3199
std::shared_ptr< PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:320
bool mbSuppressAccessibilityEvents
Definition: window.h:318
VclPtr< vcl::Window > mpNextFrame
Definition: window.h:133
unsigned long nRightDecoration
Definition: salgeom.hxx:33
bool mbReallyVisible
Definition: window.h:318
const Size & GetMaxOutputSizePixel() const
Definition: syswin.cxx:429
const MapMode & GetMapMode() const
Definition: outdev.hxx:1679
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
sal_Int32 mnDPIY
Definition: outdev.hxx:346
sal_uInt16 GetCode() const
Definition: keycod.hxx:53
SAL_DLLPRIVATE void ImplInsertWindow(vcl::Window *pParent)
Definition: stacking.cxx:58
virtual void Deactivate()
Definition: window.cxx:1834
long mnDestWidth
Definition: salgtype.hxx:56
SAL_DLLPRIVATE tools::Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel(const tools::Rectangle &rRect) const
Definition: window.cxx:2919
PosSizeFlags
Definition: window.hxx:140
void SetFakeFocus(bool bFocus)
Set this when you need to act as if the window has focus even if it doesn't.
Definition: window.cxx:3029
WindowType mnType
Definition: window.h:296
ImplWinData * mpWinData
Definition: window.h:225
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2843
sal_Int32 mnDPIX
Definition: outdev.hxx:345
long mnSrcX
Definition: salgtype.hxx:50
sal_Int32 mnDPIY
Definition: window.h:142
ShowFlags
Definition: window.hxx:159
long mnCursorExtWidth
Definition: window.h:108
virtual void SetSettings(const AllSettings &rSettings)
Definition: outdev.cxx:213
bool mbCallHandlersDuringInputDisabled
Definition: window.h:318
bool mbHasFocus
Definition: window.h:159
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
SAL_DLLPRIVATE const LogicalFontInstance * GetFontInstance() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: window.cxx:145
tools::Rectangle GetBoundRect() const
Definition: region.cxx:1214
~ImplWinData()
Definition: window.cxx:761
bool mbEnableRTL
Definition: outdev.hxx:392
long AdjustHeight(long n)
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3034
#define EXTTEXTINPUT_CURSOR_OVERWRITE
void SetMapMode()
Definition: map.cxx:655
HelpEventMode GetMode() const
Definition: event.hxx:205
ImplSVGDIData maGDIData
Definition: svdata.hxx:393
bool IsTracking() const
Definition: window2.cxx:312
void Tracking(const TrackingEvent &rTEvt)
Definition: dockmgr.cxx:548
const Color & GetHighlightColor() const
void SetClipboard(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &xClipboard)
Sets a custom clipboard for the window's frame, instead of creating it on-demand using css::datatrans...
Definition: window.cxx:3447
Color GetBackgroundColor() const override
Definition: window.cxx:586
SAL_DLLPRIVATE void ImplInvalidateFrameRegion(const vcl::Region *pRegion, InvalidateFlags nFlags)
Definition: paint.cxx:684
bool mbMouseIn
Definition: window.h:161
std::shared_ptr< PhysicalFontCollection > mxFontCollection
Definition: window.h:139
bool mbMinimized
Definition: window.h:164
#define COMPAT_BODY(method, args)
Definition: window.cxx:3858
bool SelectClipRegion(const vcl::Region &, SalGraphics *pGraphics=nullptr)
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:926
NONE
SAL_DLLPRIVATE ImplWinData * ImplGetWinData() const
Definition: window.cxx:1210
bool mbCommand
Definition: window.h:318
bool IsEmpty() const
bool mbSecondary
Definition: window.h:318
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
StateChangedType
Definition: window.hxx:310
#define SAL_FRAME_EXT_STYLE_DOCUMENT
Definition: salframe.hxx:99
unsigned long nBottomDecoration
Definition: salgeom.hxx:33
bool mbInSysObjFocusHdl
Definition: window.h:166
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2713
WinBits const WB_OWNERDRAWDECORATION
sal_Int64 WinBits
long mnDestY
Definition: salgtype.hxx:55
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
void SetBackground()
ScrollFlags
Definition: window.hxx:241
bool mbSettingsInit
Definition: svdata.hxx:153
const OUString & get_id() const
Get the ID of the window.
Definition: window.cxx:3905
virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3166
vcl::Region maWinClipRegion
Definition: window.h:289
WindowBorderStyle GetBorderStyle() const
Definition: window.cxx:2029
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2427
bool mbPaintTransparent
Definition: window.h:318
bool mbCompoundControl
Definition: window.h:318
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:604
bool mbInternalDragGestureRecognizer
Definition: window.h:177
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set...
Definition: window.cxx:3279
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: window.cxx:3380
VclPtr< vcl::Window > mpPrev
Definition: window.h:239
enumrange< T >::Iterator begin(enumrange< T >)
SAL_DLLPRIVATE void ImplInvalidate(const vcl::Region *rRegion, InvalidateFlags nFlags)
Definition: paint.cxx:775
void CompatGetFocus()
Definition: window.cxx:3864
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
VclPtr< OutputDevice > mpFirstWinGraphics
Definition: svdata.hxx:211
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion(vcl::Region &rRegion)
Definition: paint.cxx:764
const vcl::Font & GetFont() const
Definition: outdev.hxx:649
~WindowImpl()
Definition: window.cxx:744
bool mbFocusVisible
Definition: window.h:318
sal_Int32 mnMarginRight
Definition: window.h:315
VclPtr< vcl::Window > mpMouseMoveWin
Definition: window.h:136
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetPrimarySelection()
Definition: window.cxx:3462
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
Definition: window2.cxx:272
virtual void Tracking(const TrackingEvent &rTEvt)
Definition: window.cxx:1927
static bool IsFuzzing()
SAL_DLLPRIVATE void ImplShowAllOverlaps()
Definition: stacking.cxx:390
void remove_from_all_size_groups()
Definition: window2.cxx:1936
virtual void EndExtTextInput(EndExtTextInputFlags nFlags)=0
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
SAL_DLLPRIVATE void ImplPosSizeWindow(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
Definition: window.cxx:1442
void Hide()
Definition: window.hxx:936
sal_uInt16 mnMouseCode
Definition: window.h:157
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:371
SAL_DLLPRIVATE void ImplGrabFocusToDocument(GetFocusFlags nFlags)
Definition: mouse.cxx:393
SAL_DLLPRIVATE void ImplRemoveWindow(bool bRemoveFrameData)
Definition: stacking.cxx:112
VclPtr< vcl::Window > mpLastChild
Definition: window.h:236
VclEventId
Definition: vclevent.hxx:39
sal_Int32 mnWidthRequest
Definition: window.h:269
bool mbKeyInput
Definition: window.h:318
SAL_DLLPRIVATE void CollectChildren(::std::vector< vcl::Window * > &rAllChildren)
Add all children to rAllChildren recursively.
Definition: window.cxx:2156
::std::list< VclPtr< vcl::Window > > maTopWindowChildren
Definition: window.h:122
sal_uInt64 SalExtStyle
Definition: salframe.hxx:95
bool mbFloatWin
Definition: window.h:318
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1314
bool IsTopWindow() const
Definition: stacking.cxx:612
void SetBorderStyle(WindowBorderStyle nBorderStyle)
Definition: window.cxx:1989
bool mbInitWinClipRegion
Definition: window.h:318
sal_uInt16 GetModifier() const
Definition: keycod.hxx:56
virtual OUString GetText() const
Definition: window.cxx:3085
bool mbIsInTaskPaneList
Definition: window.h:318
WinBits const WB_SYSTEMFLOATWIN
Application * GetpApp()
Definition: svapp.cxx:150
bool mbFill
Definition: window.h:318
bool mbClipChildren
Definition: window.h:318
static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness)
void SetModalHierarchyHdl(const Link< bool, void > &rLink)
Definition: window.cxx:1779
virtual OUString GetDisplayText() const
Definition: window.cxx:3091
const tools::Rectangle * GetCursorRect() const
Definition: window.cxx:2128
bool mbSysWin
Definition: window.h:318
void IncModalCount()
Definition: window.cxx:3617
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
Definition: outdev.cxx:513
const Size & GetMinOutputSizePixel() const
Definition: syswin.hxx:153
virtual void DrawOutDevDirectProcess(const OutputDevice *pSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
Definition: window.cxx:1265
bool mbAutoAccel
Definition: svdata.hxx:332
virtual Selection GetSurroundingTextSelection() const
Definition: window.cxx:3816
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
SAL_DLLPRIVATE void ImplFocusToTop(ToTopFlags nFlags, bool bReallyVisible)
Definition: stacking.cxx:363
std::unique_ptr< AllSettings > mxSettings
Definition: outdev.hxx:368
css::uno::Reference< css::lang::XComponent > xComponent
WINDOW
const vcl::Font & GetFont() const
Definition: inputctx.hxx:55
bool mbReallyShown
Definition: window.h:318
void SetDebugName(const char *pDebugName)
Definition: task.hxx:81
const Point & GetMousePosPixel() const
Definition: event.hxx:204
bool mbDrawSelectionBackground
Definition: window.h:318
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:314
#define SAL_FRAME_EXT_STYLE_DOCMODIFIED
Definition: salframe.hxx:100
WinBits const WB_INTROWIN
bool mbDisabled
Definition: window.h:318
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
Definition: svapp.cxx:1035
ParentClipMode mnParentClipMode
Definition: window.h:301
void EnableInput(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2504
bool CompatPreNotify(NotifyEvent &rNEvt)
Definition: window.cxx:3884
void EnableNativeWidget(bool bEnable=true)
Definition: window.cxx:3696
const InputContext & GetInputContext() const
Definition: window2.cxx:1062
bool mbFrame
Definition: window.h:318
SAL_DLLPRIVATE tools::Rectangle ImplGetWindowExtentsRelative(vcl::Window *pRelativeWindow) const
Definition: window.cxx:2942
bool mbInDispose
Definition: window.h:318
WinBits const WB_DIALOGCONTROL
SAL_DLLPRIVATE void ImplPointToLogic(vcl::RenderContext const &rRenderContext, vcl::Font &rFont) const
Definition: window.cxx:1358
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
bool mbDefSize
Definition: window.h:318
bool IsEmpty() const
Definition: region.cxx:228
void SetLineColor()
const OString & GetHelpId() const
Definition: window2.cxx:828
virtual OUString GetHelpText(const OUString &aHelpURL, const vcl::Window *pWindow)
Definition: help.cxx:67
VCLXWindow * mpVCLXWindow
Definition: window.h:287
virtual void SetInputContext(SalInputContext *pContext)=0
friend void ImplHandleResize(vcl::Window *pWindow, long nNewWidth, long nNewHeight)
Definition: winproc.cxx:1645
bool mbInSysObjToTopHdl
Definition: window.h:167
long mnX
Definition: window.h:273
AlwaysInputMode meAlwaysInputMode
Definition: window.h:304
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)=0
void SetActivateMode(ActivateModeFlags nMode)
Definition: window.cxx:2682
bool mbPaintDisabled
Definition: window.h:318
vcl::LOKWindowId mnLOKWindowId
ID of this specific window.
Definition: window.h:397
WindowExtendedStyle mnExtendedStyle
Definition: window.h:295
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
Window(WindowType nType)
Definition: window.cxx:89
long mnLastMouseWinX
Definition: window.h:151
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY)=0
WinBits mnStyle
Definition: window.h:293
void SetInputContext(const InputContext &rInputContext)
Definition: window.cxx:2071
void SetWindowPeer(css::uno::Reference< css::awt::XWindowPeer > const &xPeer, VCLXWindow *pVCLXWindow)
Definition: window.cxx:3154
bool mbNativeFocusVisible
Definition: window.h:318
const vcl::ILibreOfficeKitNotifier * mpLOKNotifier
To emit the LOK callbacks eg. for dialog tunneling.
Definition: window.h:396
VclPtr< vcl::Window > mpLastFocusWindow
Definition: window.h:242
virtual bool EventNotify(NotifyEvent &rNEvt)
Definition: event.cxx:103
int i
virtual OUString GetSurroundingText() const
Definition: window.cxx:3811
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle)=0
bool mbChildPtrOverwrite
Definition: window.h:318
sal_Int32 mnOptimalWidthCache
Definition: window.h:271
DrawFlags
Definition: window.hxx:353
VclPtr< vcl::Window > mpIntroWindow
Definition: svdata.hxx:400
void SetCallHandlersOnInputDisabled(bool bCall)
usually event handlers (see AddEventListener and AddChildEventListener) are not called on disabled...
Definition: window.cxx:2487
bool IsSystemWindow() const
Definition: window2.cxx:997
bool IsDark() const
Color maControlForeground
Definition: window.h:263
virtual void dispose() override
Definition: outdev.cxx:141
void DrawSelectionBackground(const tools::Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder)
Definition: window.cxx:3480
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3725
void SetCursorRect(const tools::Rectangle *pRect=nullptr, long nExtTextInputWidth=0)
Definition: window.cxx:2107
std::unique_ptr< tools::Rectangle[]> mpCompositionCharRects
Definition: window.h:111
ImplDockingWindowWrapper.
Definition: dockwin.hxx:71
VclAlign meValign
Definition: window.h:306
css::uno::Reference< css::rendering::XSpriteCanvas > GetSpriteCanvas() const
request XSpriteCanvas render interface for this window
Definition: window.cxx:3804
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
VclPtr< vcl::Window > mpLastWheelWindow
Definition: svdata.hxx:257
long mnBeforeLastMouseX
Definition: window.h:147
void SetParent(vcl::Window *pNewParent)
Definition: stacking.cxx:842
bool mbInShowFocus
Definition: window.h:318
virtual void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: window.cxx:3826
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
bool mbInInitShow
Definition: window.h:318
const Color & GetColor() const
Definition: wall.cxx:204
KeyIndicatorState
Definition: keycodes.hxx:180
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:588
sal_Int32 mnMarginTop
Definition: window.h:316
void SetUpdateMode(bool bUpdate)
Definition: window.cxx:2997
sal_Int32 mnTouchPanPosition
Definition: window.h:169
ShowTrackFlags
Definition: window.hxx:268
bool mbNoParentUpdate
Definition: window.h:318
long mnLastMouseX
Definition: window.h:145
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:636
bool mbInitLineColor
Definition: outdev.hxx:382
bool mbInMouseMove
Definition: window.h:160
virtual bool Start(const OUString &rHelpId, const vcl::Window *pWindow)
Definition: help.cxx:53
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
const Color & GetLineColor() const
Definition: outdev.hxx:630
SAL_DLLPRIVATE void ImplGenerateMouseMove()
Definition: mouse.cxx:157
ActivateModeFlags
Definition: window.hxx:186
vcl::Region maWinRegion
Definition: window.h:288
VclPtr< vcl::Window > mpFirstOverlap
Definition: window.h:134
bool IsDialog() const
Definition: window2.cxx:1002
void SetTextColor(const Color &rColor)
Definition: text.cxx:665
bool HasPaintEvent() const
Definition: paint.cxx:1259
static bool GetLayoutRTL()
virtual void Draw(::OutputDevice *pDev, const Point &rPos, DrawFlags nFlags)
Definition: window.cxx:1824
rtl::Reference< LogicalFontInstance > mpFont
Definition: salwtype.hxx:248
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:510
bool IsInModalMode() const
A window is in modal mode if one of its children or subchildren is a running modal window (a modal di...
Definition: window.cxx:3612
VclPtr< vcl::Window > mpLastOverlap
Definition: window.h:238
bool mbOverlapVisible
Definition: window.h:318
virtual void Resize()
Definition: window.cxx:1830
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:865
Point NormalizedScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2892
SAL_DLLPRIVATE void ImplShow()
Definition: cursor.cxx:285
virtual void DestroyFrame(SalFrame *pFrame)=0
const Size & GetFontSize() const
Definition: font/font.cxx:673
InputContextFlags mnOptions
Definition: salwtype.hxx:249
void GrabFocusToDocument()
Definition: window.cxx:3016
void Intersect(const tools::Rectangle &rRegion)
Definition: region.cxx:584
vcl::Font maFont
Definition: outdev.hxx:362
bool mbHelpTextDynamic
Definition: window.h:318
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Definition: stacking.cxx:680
WinBits const WB_TOOLTIPWIN
All repaint events should go in here.
bool mbWinRegion
Definition: window.h:318
void SetHelpHdl(const Link< vcl::Window &, bool > &rLink)
Definition: window.cxx:1856
SalObject * mpSysObj
Definition: window.h:228
bool IsMouseCaptured() const
Definition: mouse.cxx:469
virtual const OutputDevice * DrawOutDevDirectCheck(const OutputDevice *pSrcDev) const override
Definition: window.cxx:1250
PointerStyle maPointer
Definition: window.h:258
bool mbDockWin
Definition: window.h:318
bool mbSysObjFocus
Definition: window.h:168
RasterOp meRasterOp
Definition: outdev.hxx:366
void SetModalHierarchyHdl(const Link< bool, void > &rLink)
Definition: salframe.hxx:295
const AllSettings & GetSettings() const
Definition: outdev.hxx:418
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
VclPtr< vcl::Window > mpDlgCtrlDownWindow
Definition: window.h:243
SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX()
Definition: window.cxx:2862
bool mbInitTextColor
Definition: outdev.hxx:385
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Definition: svapp.cxx:1211
css::uno::Any GetSystemGfxDataAny() const
Definition: outdev.cxx:269
VclPtr< vcl::Window > mpOverlapWindow
Definition: window.h:230
Reference< XClipboard > GetSystemClipboard()
Definition: transfer2.cxx:462
VclAlign meHalign
Definition: window.h:305
VclPtr< vcl::Window > mpClientWindow
Definition: window.h:232
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:249
SAL_DLLPRIVATE void ImplSetReallyVisible()
Definition: window.cxx:1288
sal_uInt16 mnModalMode
Definition: window.h:153
void RequestDoubleBuffering(bool bRequest)
Enable/disable double-buffering of the frame window and all its children.
Definition: window.cxx:3841
virtual void LoseFocus()
Definition: window.cxx:1850
constexpr sal_uInt16 KEY_MOD2
Definition: keycodes.hxx:32
sal_uInt16 mnClickCount
Definition: window.h:155
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2856
bool mbInPaint
Definition: window.h:318
ControlPart mnNativeBackground
Definition: window.h:297
void GrabFocus()
Definition: window.cxx:3006
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:895
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:180
vcl::Window * GetParent() const
Definition: window2.cxx:1097
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:253
long mnAppFontX
Definition: svdata.hxx:226
SAL_DLLPRIVATE void ImplLogicToPoint(vcl::RenderContext const &rRenderContext, vcl::Font &rFont) const
Definition: window.cxx:1378
InputContextFlags GetOptions() const
Definition: inputctx.hxx:58
SAL_DLLPRIVATE void ImplCalcOverlapRegion(const tools::Rectangle &rSourceRect, vcl::Region &rRegion, bool bChildren, bool bSiblings)
unsigned long nTopDecoration
Definition: salgeom.hxx:33
VclPtr< vcl::Window > mpBorderWindow
Definition: window.h:231
VclPtr< vcl::Window > mpFirstOverlap
Definition: window.h:237
void SetParentToDefaultWindow()
Definition: window.cxx:1784
bool mbInFocusHdl
Definition: window.h:318
std::optional< tools::Rectangle > mpCursorRect
Definition: window.h:107
void SetStyle(WinBits nStyle)
Definition: window.cxx:1957
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2899
bool mbVertical
Definition: window.h:109
enumrange< T >::Iterator end(enumrange< T >)
bool IsCompoundControl() const
Definition: window2.cxx:1193
void put(const char *pPropName, const OUString &rPropValue)
css::uno::Reference< css::rendering::XCanvas > GetCanvas() const
request XCanvas render interface for this window
Definition: window.cxx:3799
ImplFrameData(vcl::Window *pWindow)
Definition: window.cxx:766
sal_Int32 mnDPIX
Definition: window.h:141
WindowImpl(const WindowImpl &)=delete
long GetCursorExtTextInputWidth() const
Definition: window.cxx:2135
SalFrame * mpFrame
Definition: window.h:227
sal_Int32 mnLeftBorder
Definition: window.h:265
SAL_DLLPRIVATE void ImplCallDeactivateListeners(vcl::Window *)
Definition: window.cxx:3410
virtual const SystemEnvData * GetSystemData() const
Definition: window.cxx:3830
WinBits const WB_SYSTEMCHILDWINDOW
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2168
sal_uInt32 LOKWindowId
bool mbExpand
Definition: window.h:318
long mnSrcY
Definition: salgtype.hxx:51
bool mbControlBackground
Definition: window.h:318
VclPtr< vcl::Window > mpNext
Definition: window.h:240
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1187
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:942
void ReleaseMouse()
Definition: mouse.cxx:458
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1800
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:936
WinBits const WB_3DLOOK
bool mbToolBox
Definition: window.h:318
static bool IsLOKWindowsEmpty()
check if LOK Window container is empty
Definition: window.cxx:3232
bool mbUseNativeFocus
Definition: window.h:318
SAL_DLLPRIVATE void ImplDlgCtrlNextWindow()
Definition: dlgctrl.cxx:1001
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
WinBits const WB_SIZEABLE
bool mbDoubleBufferingRequested
Definition: window.h:318
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
Definition: window2.cxx:880
bool mbMouseButtonDown
Definition: window.h:318
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:315
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: window.cxx:2418
SAL_DLLPRIVATE void ImplUpdateSysObjClip()
void set_id(const OUString &rID)
Sets an ID.
Definition: window.cxx:3900
Idle maResizeIdle
Definition: window.h:131
long CalcTitleWidth() const
Definition: window.cxx:2043
bool mbWaitSystemResize
Definition: window.h:318
bool mbNoUpdate
Definition: window.h:318
A construction helper for a temporary VclPtr.
Definition: vclptr.hxx:275
bool mbExtTextInput
Definition: window.h:318
SalFrame * ImplGetFrame() const
Definition: window2.cxx:848
SAL_DLLPRIVATE void ImplHideAllOverlaps()
Definition: stacking.cxx:405
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
sal_Int32 mnGridLeftAttach
Definition: window.h:310
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:54
virtual void Scroll(long nHorzScroll, long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
Definition: window.cxx:2970
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
Definition: syswin.cxx:1009
void Exclude(const tools::Rectangle &rRegion)
Definition: region.cxx:675
vcl::Window * GetAccessibleRelationLabelFor() const
void CopyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev)
bool IsGradient() const
Definition: wall.cxx:283
SAL_DLLPRIVATE vcl::Region ImplPixelToDevicePixel(const vcl::Region &rRegion) const
Convert a region in pixel units to a region in device pixel units and coords.
Definition: map.cxx:637
bool mbCallMove
Definition: window.h:318
bool mbBorderWin
Definition: window.h:318
void RemoveWindow(const vcl::Window *pWin)
Definition: dockmgr.cxx:384
VclPtr< vcl::Window > mpExtTextInputWin
Definition: svdata.hxx:252
virtual void ReleaseGraphics(bool bRelease=true)=0
Release the graphics device, and remove it from the graphics device list.
void AlwaysEnableInput(bool bAlways, bool bChild=true)
Override EnableInput.
Definition: window.cxx:2628
std::shared_ptr< ImplFontCache > mxFontCache
Definition: window.h:140
static void Abort(const OUString &rErrorText)
Ends the program prematurely with an error message.
Definition: svapp.cxx:263
DockingManager * ImplGetDockingManager()
Definition: svdata.cxx:308
int mnChildEventListenersIteratingCount
Definition: window.h:248
WindowType
SAL_DLLPRIVATE void ImplStartToTop(ToTopFlags nFlags)
Definition: stacking.cxx:314
VclPtr< vcl::Window > mpMouseDownWin
Definition: window.h:137
SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
Definition: svapp.cxx:1534
const vcl::Font & GetTitleFont() const
virtual void GetFocus()
Definition: window.cxx:1836
const Color & GetButtonTextColor() const
bool mbNoFocusRects
Definition: svdata.hxx:320
#define SAL_WARN_IF(condition, area, stream)
SAL_DLLPRIVATE void ImplMirrorFramePos(Point &pt) const
Definition: window.cxx:3606
bool mbActive
Definition: window.h:318
WinBits const WB_BORDER
bool mbEnableNativeWidget
Definition: window.h:120
SAL_DLLPRIVATE void ImplExcludeWindowRegion(vcl::Region &rRegion)
void RecordLayoutData(vcl::ControlLayoutData *pLayout, const tools::Rectangle &rRect)
Definition: window.cxx:3471
bool mbMouseTransparent
Definition: window.h:318
bool mbLOKParentNotifier
Definition: window.h:398
void SetCursor(vcl::Cursor *pCursor)
Definition: window.cxx:3043
long mnDestX
Definition: salgtype.hxx:54