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