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