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