LibreOffice Module vcl (master)  1
event.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 <vcl/event.hxx>
21 #include <vcl/window.hxx>
22 #include <vcl/dockwin.hxx>
23 #include <vcl/layout.hxx>
24 #include <sal/log.hxx>
25 
26 #include <window.h>
27 #include <svdata.hxx>
28 #include <salframe.hxx>
29 #include <config_features.h>
31 
32 #include "impldockingwrapper.hxx"
33 
34 namespace vcl {
35 
37 {
38 }
39 
41 {
42  CompatDataChanged( rDCEvt );
43 
44  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
45  while ( pChild )
46  {
47  pChild->NotifyAllChildren( rDCEvt );
48  pChild = pChild->mpWindowImpl->mpNext;
49  }
50 }
51 
53 {
54  bool bDone = false;
55  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
56  bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
57 
58  if ( !bDone )
59  {
60  if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
61  {
62  bool bCompoundFocusChanged = false;
63  if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
64  {
65  mpWindowImpl->mbCompoundControlHasFocus = true;
66  bCompoundFocusChanged = true;
67  }
68 
69  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
71  }
72  else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
73  {
74  bool bCompoundFocusChanged = false;
75  if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
76  {
77  mpWindowImpl->mbCompoundControlHasFocus = false ;
78  bCompoundFocusChanged = true;
79  }
80 
81  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
83  }
84 
85  // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
86  // see also ImplHandleMouseEvent(), ImplHandleKey()
87 
88  }
89 
90  return bDone;
91 }
92 
93 namespace
94 {
95  bool parentNotDialogControl(Window* pWindow)
96  {
97  vcl::Window* pParent = getNonLayoutParent(pWindow);
98  if (!pParent)
99  return true;
100  return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
101  }
102 }
103 
105 {
106  bool bRet = false;
107 
108  if (isDisposed())
109  return false;
110 
111  // check for docking window
112  // but do nothing if window is docked and locked
114  if (pWrapper && ( pWrapper->IsFloatingMode() || !pWrapper->IsLocked() ))
115  {
116  const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
117 
119  {
120  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
121  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
122  if ( pMEvt->IsLeft() )
123  {
124  if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
125  {
126  // ctrl double click toggles floating mode
127  pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
128  return true;
129  }
130  else if ( pMEvt->GetClicks() == 1 && bHit)
131  {
132  // allow start docking during mouse move
133  pWrapper->ImplEnableStartDocking();
134  return true;
135  }
136  }
137  }
138  else if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
139  {
140  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
141  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
142  if ( pMEvt->IsLeft() )
143  {
144  // check if a single click initiated this sequence ( ImplStartDockingEnabled() )
145  // check if window is docked and
146  if( pWrapper->ImplStartDockingEnabled() && !pWrapper->IsFloatingMode() &&
147  !pWrapper->IsDocking() && bHit )
148  {
149  Point aPos = pMEvt->GetPosPixel();
150  vcl::Window* pWindow = rNEvt.GetWindow();
151  if ( pWindow != this )
152  {
153  aPos = pWindow->OutputToScreenPixel( aPos );
154  aPos = ScreenToOutputPixel( aPos );
155  }
156  pWrapper->ImplStartDocking( aPos );
157  }
158  return true;
159  }
160  }
161  else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
162  {
163  const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
164  if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
165  rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
166  {
167  pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
168  /* At this point the floating toolbar frame does not have the
169  * input focus since these frames don't get the focus per default
170  * To enable keyboard handling of this toolbar set the input focus
171  * to the frame. This needs to be done with ToTop since GrabFocus
172  * would not notice any change since "this" already has the focus.
173  */
174  if( pWrapper->IsFloatingMode() )
176  return true;
177  }
178  }
179  }
180 
181  // manage the dialogs
183  {
184  // if the parent also has dialog control activated, the parent takes over control
185  if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
186  {
187  // ScGridWindow has WB_DIALOGCONTROL set, so pressing tab in ScCheckListMenuControl won't
188  // get processed here by the toplevel DockingWindow of ScCheckListMenuControl by
189  // just checking if parentNotDialogControl is true
190  bool bTopLevelFloatingWindow = (pWrapper && pWrapper->IsFloatingMode());
191  if (ImplIsOverlapWindow() || parentNotDialogControl(this) || bTopLevelFloatingWindow)
192  {
193  bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
194  }
195  }
196  else if ( (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) || (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS) )
197  {
199  if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
200  !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
201  {
203  if ( pFirstChild )
204  pFirstChild->ImplControlFocus();
205  }
206  }
207  }
208 
209  if ( !bRet )
210  {
211  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
212  bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
213  }
214 
215  return bRet;
216 }
217 
218 void Window::CallEventListeners( VclEventId nEvent, void* pData )
219 {
220  VclWindowEvent aEvent( this, nEvent, pData );
221 
222  VclPtr<vcl::Window> xWindow = this;
223 
225 
226  if ( xWindow->isDisposed() )
227  return;
228 
229  // If maEventListeners is empty, the XVCLWindow has not yet been initialized.
230  // Calling GetComponentInterface will do that.
231  if (mpWindowImpl->maEventListeners.empty() && pData)
232  xWindow->GetComponentInterface();
233 
234  if (!mpWindowImpl->maEventListeners.empty())
235  {
236  // Copy the list, because this can be destroyed when calling a Link...
237  std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
238  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
239  mpWindowImpl->mnEventListenersIteratingCount++;
240  auto& rWindowImpl = *mpWindowImpl;
241  comphelper::ScopeGuard aGuard(
242  [&rWindowImpl, &xWindow]()
243  {
244  if (!xWindow->isDisposed())
245  {
246  rWindowImpl.mnEventListenersIteratingCount--;
247  if (rWindowImpl.mnEventListenersIteratingCount == 0)
248  rWindowImpl.maEventListenersDeleted.clear();
249  }
250  }
251  );
252  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
253  {
254  if (xWindow->isDisposed()) break;
255  // check this hasn't been removed in some re-enterancy scenario fdo#47368
256  if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
257  rLink.Call( aEvent );
258  }
259  }
260 
261  while ( xWindow )
262  {
263 
264  if ( xWindow->isDisposed() )
265  return;
266 
267  auto& rWindowImpl = *xWindow->mpWindowImpl;
268  if (!rWindowImpl.maChildEventListeners.empty())
269  {
270  // Copy the list, because this can be destroyed when calling a Link...
271  std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
272  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
273  rWindowImpl.mnChildEventListenersIteratingCount++;
274  comphelper::ScopeGuard aGuard(
275  [&rWindowImpl, &xWindow]()
276  {
277  if (!xWindow->isDisposed())
278  {
279  rWindowImpl.mnChildEventListenersIteratingCount--;
280  if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
281  rWindowImpl.maChildEventListenersDeleted.clear();
282  }
283  }
284  );
285  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
286  {
287  if (xWindow->isDisposed())
288  return;
289  // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
290  if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
291  rLink.Call( aEvent );
292  }
293  }
294 
295  if ( xWindow->isDisposed() )
296  return;
297 
298  xWindow = xWindow->GetParent();
299  }
300 }
301 
303 {
304  mpWindowImpl->maEventListeners.push_back( rEventListener );
305 }
306 
308 {
309  if (mpWindowImpl)
310  {
311  auto& rListeners = mpWindowImpl->maEventListeners;
312  rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
313  if (mpWindowImpl->mnEventListenersIteratingCount)
314  mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
315  }
316 }
317 
319 {
320  mpWindowImpl->maChildEventListeners.push_back( rEventListener );
321 }
322 
324 {
325  if (mpWindowImpl)
326  {
327  auto& rListeners = mpWindowImpl->maChildEventListeners;
328  rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
329  if (mpWindowImpl->mnChildEventListenersIteratingCount)
330  mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener);
331  }
332 }
333 
334 ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink )
335 {
336  std::unique_ptr<ImplSVEvent> pSVEvent(new ImplSVEvent);
337  pSVEvent->mpData = pCaller;
338  pSVEvent->maLink = rLink;
339  pSVEvent->mpWindow = this;
340  pSVEvent->mbCall = true;
341  if (bReferenceLink)
342  {
343  pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
344  }
345 
346  auto pTmpEvent = pSVEvent.get();
347  if (!mpWindowImpl->mpFrame->PostEvent( std::move(pSVEvent) ))
348  return nullptr;
349  return pTmpEvent;
350 }
351 
353 {
354  SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
355  "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
356  SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
357  "Window::RemoveUserEvent(): Event is already removed" );
358 
359  if ( nUserEvent->mpWindow )
360  {
361  nUserEvent->mpWindow = nullptr;
362  }
363 
364  nUserEvent->mbCall = false;
365 }
366 
367 
368 static MouseEvent ImplTranslateMouseEvent( const MouseEvent& rE, vcl::Window const * pSource, vcl::Window const * pDest )
369 {
370  // the mouse event occurred in a different window, we need to translate the coordinates of
371  // the mouse cursor within that (source) window to the coordinates the mouse cursor would
372  // be in the destination window
373  Point aPos = pSource->OutputToScreenPixel( rE.GetPosPixel() );
374  return MouseEvent( pDest->ScreenToOutputPixel( aPos ), rE.GetClicks(), rE.GetMode(), rE.GetButtons(), rE.GetModifier() );
375 }
376 
378 {
379  if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
380  {
381  const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
382  if ( pCEvt->GetCommand() != CommandEventId::ContextMenu )
383  // non context menu events are not to be notified up the chain
384  // so we return immediately
385  return;
386 
387  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
388  {
389  // not interested: The event listeners are already called in ::Command,
390  // and calling them here a second time doesn't make sense
391  if ( rNEvt.GetWindow() != this )
392  {
393  CommandEvent aCommandEvent;
394 
395  if ( !pCEvt->IsMouseEvent() )
396  {
397  aCommandEvent = *pCEvt;
398  }
399  else
400  {
401  // the mouse event occurred in a different window, we need to translate the coordinates of
402  // the mouse cursor within that window to the coordinates the mouse cursor would be in the
403  // current window
404  vcl::Window* pSource = rNEvt.GetWindow();
405  Point aPos = pSource->OutputToScreenPixel( pCEvt->GetMousePosPixel() );
406  aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() );
407  }
408 
410  }
411  }
412  }
413 
414  // #82968# notify event listeners for mouse and key events separately and
415  // not in PreNotify ( as for focus listeners )
416  // this allows for processing those events internally first and pass it to
417  // the toolkit later
418 
419  VclPtr<vcl::Window> xWindow = this;
420 
421  if( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
422  {
423  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
424  {
425  if ( rNEvt.GetWindow() == this )
426  CallEventListeners( VclEventId::WindowMouseMove, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
427  else
428  {
429  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
431  }
432  }
433  }
434  else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONUP )
435  {
436  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
437  {
438  if ( rNEvt.GetWindow() == this )
439  CallEventListeners( VclEventId::WindowMouseButtonUp, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
440  else
441  {
442  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
444  }
445  }
446  }
447  else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
448  {
449  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
450  {
451  if ( rNEvt.GetWindow() == this )
452  CallEventListeners( VclEventId::WindowMouseButtonDown, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
453  else
454  {
455  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
457  }
458  }
459  }
460  else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
461  {
462  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
463  CallEventListeners( VclEventId::WindowKeyInput, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
464  }
465  else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP )
466  {
467  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
468  CallEventListeners( VclEventId::WindowKeyUp, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
469  }
470 
471  if ( xWindow->isDisposed() )
472  return;
473 
474  // #106721# check if we're part of a compound control and notify
475  vcl::Window *pParent = ImplGetParent();
476  while( pParent )
477  {
478  if( pParent->IsCompoundControl() )
479  {
480  pParent->ImplNotifyKeyMouseCommandEventListeners( rNEvt );
481  break;
482  }
483  pParent = pParent->ImplGetParent();
484  }
485 }
486 
488 {
489  mpWindowImpl->mbReallyShown = true;
490  mpWindowImpl->mbInInitShow = true;
492  mpWindowImpl->mbInInitShow = false;
493 
494  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
495  while ( pWindow )
496  {
497  if ( pWindow->mpWindowImpl->mbVisible )
498  pWindow->ImplCallInitShow();
499  pWindow = pWindow->mpWindowImpl->mpNext;
500  }
501 
502  pWindow = mpWindowImpl->mpFirstChild;
503  while ( pWindow )
504  {
505  if ( pWindow->mpWindowImpl->mbVisible )
506  pWindow->ImplCallInitShow();
507  pWindow = pWindow->mpWindowImpl->mpNext;
508  }
509 }
510 
511 
513 {
514  mpWindowImpl->mbCallResize = false;
515 
516  // Normally we avoid blanking on re-size unless people might notice:
517  if( GetBackground().IsGradient() )
518  Invalidate();
519 
520  Resize();
521 
522  // #88419# Most classes don't call the base class in Resize() and Move(),
523  // => Call ImpleResize/Move instead of Resize/Move directly...
525 }
526 
528 {
529  mpWindowImpl->mbCallMove = false;
530 
531  if( mpWindowImpl->mbFrame )
532  {
533  // update frame position
534  SalFrame *pParentFrame = nullptr;
535  vcl::Window *pParent = ImplGetParent();
536  while( pParent )
537  {
538  if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
539  {
540  pParentFrame = pParent->mpWindowImpl->mpFrame;
541  break;
542  }
543  pParent = pParent->GetParent();
544  }
545 
546  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
547  mpWindowImpl->maPos = Point( g.nX, g.nY );
548  if( pParentFrame )
549  {
550  g = pParentFrame->GetGeometry();
551  mpWindowImpl->maPos -= Point( g.nX, g.nY );
552  }
553  // the client window and all its subclients have the same position as the borderframe
554  // this is important for floating toolbars where the borderwindow is a floating window
555  // which has another borderwindow (ie the system floating window)
556  vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
557  while( pClientWin )
558  {
559  pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
560  pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
561  }
562  }
563 
564  Move();
565 
567 }
568 
570  vcl::Window* pOldOverlapWindow )
571 {
572  ImplSVData* pSVData = ImplGetSVData();
573  vcl::Window* pNewRealWindow;
574  vcl::Window* pOldRealWindow;
575  bool bCallActivate = true;
576  bool bCallDeactivate = true;
577 
578  if (!pOldOverlapWindow)
579  {
580  return;
581  }
582 
583  pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
584  if (!pNewOverlapWindow)
585  {
586  return;
587  }
588 
589  pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
590  if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
591  pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
592  {
593  if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
594  pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
595  {
596  pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
597  bCallDeactivate = false;
598  }
599  }
600  else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
601  pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
602  {
603  if (pSVData->mpWinData->mpLastDeacWin)
604  {
605  if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
606  bCallActivate = false;
607  else
608  {
609  vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
610  pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
611  pSVData->mpWinData->mpLastDeacWin->Deactivate();
612  if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
613  {
614  pLastRealWindow->mpWindowImpl->mbActive = true;
615  pLastRealWindow->Activate();
616  }
617  }
618  pSVData->mpWinData->mpLastDeacWin = nullptr;
619  }
620  }
621 
622  if ( bCallDeactivate )
623  {
624  if( pOldOverlapWindow->mpWindowImpl->mbActive )
625  {
626  pOldOverlapWindow->mpWindowImpl->mbActive = false;
627  pOldOverlapWindow->Deactivate();
628  }
629  if ( pOldRealWindow != pOldOverlapWindow )
630  {
631  if( pOldRealWindow->mpWindowImpl->mbActive )
632  {
633  pOldRealWindow->mpWindowImpl->mbActive = false;
634  pOldRealWindow->Deactivate();
635  }
636  }
637  }
638  if ( !bCallActivate || pNewOverlapWindow->mpWindowImpl->mbActive )
639  return;
640 
641  pNewOverlapWindow->mpWindowImpl->mbActive = true;
642  pNewOverlapWindow->Activate();
643 
644  if ( pNewRealWindow != pNewOverlapWindow )
645  {
646  if( ! pNewRealWindow->mpWindowImpl->mbActive )
647  {
648  pNewRealWindow->mpWindowImpl->mbActive = true;
649  pNewRealWindow->Activate();
650  }
651  }
652 }
653 
654 } /* namespace vcl */
655 
656 
658  const void* pEvent )
659 {
660  mpWindow = pWindow;
661  mpData = const_cast<void*>(pEvent);
662  mnEventType = nEventType;
663 }
664 
665 NotifyEvent::~NotifyEvent() = default;
666 
667 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Move()
Definition: window.cxx:1823
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:829
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1136
SAL_DLLPRIVATE void ImplCallResize()
Definition: event.cxx:512
SalFrameGeometry GetGeometry() const
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:332
void NotifyAllChildren(DataChangedEvent &rDCEvt)
Definition: event.cxx:40
WinBits const WB_NODIALOGCONTROL
MouseEventModifiers GetMode() const
Definition: event.hxx:124
SAL_DLLPRIVATE void ImplCallMove()
Definition: event.cxx:527
SAL_DLLPRIVATE void ImplCallInitShow()
Definition: event.cxx:487
void ImplStartDocking(const Point &rPos)
Definition: dockmgr.cxx:511
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3877
sal_uInt16 GetCode() const
Definition: keycod.hxx:51
virtual void Deactivate()
Definition: window.cxx:1829
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:323
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:316
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:2993
bool IsFloatingMode() const
Definition: dockmgr.cxx:1042
MouseNotifyEvent mnEventType
Definition: event.hxx:293
void * mpData
Definition: event.hxx:292
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:925
sal_uInt16 GetClicks() const
Definition: event.hxx:126
vcl::Window * GetWindow() const
Definition: event.hxx:309
virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3134
sal_uInt16 GetButtons() const
Definition: event.hxx:147
bool IsMouseEvent() const
VclEventId
Definition: vclevent.hxx:37
sal_uInt16 GetModifier() const
Definition: keycod.hxx:54
void * GetEventData() const
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
Definition: dlgctrl.cxx:515
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
Definition: dlgctrl.cxx:204
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
Definition: svapp.cxx:787
WinBits const WB_DIALOGCONTROL
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged(vcl::Window *pWindow, bool bGetFocus)
Definition: dlgctrl.cxx:1088
SAL_DLLPRIVATE bool ImplDlgCtrl(const KeyEvent &rKEvt, bool bKeyInput)
Definition: dlgctrl.cxx:618
bool mbCall
Definition: svdata.hxx:456
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
virtual bool EventNotify(NotifyEvent &rNEvt)
Definition: event.cxx:104
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:418
ImplDockingWindowWrapper.
tools::Long nY
Definition: salgeom.hxx:30
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1144
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners(NotifyEvent &rNEvt)
Definition: event.cxx:377
CommandEventId GetCommand() const
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:496
virtual void Resize()
Definition: window.cxx:1825
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:859
MouseNotifyEvent GetType() const
Definition: event.hxx:308
bool IsInside(const Point &rPOINT) const
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:250
sal_uInt16 GetModifier() const
Definition: event.hxx:156
static SAL_DLLPRIVATE void ImplCallFocusChangeActivate(vcl::Window *pNewOverlapWindow, vcl::Window *pOldOverlapWindow)
Definition: event.cxx:569
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2798
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
vcl::Window * GetParent() const
Definition: window2.cxx:1096
bool IsCompoundControl() const
Definition: window2.cxx:1192
tools::Long nX
Definition: salgeom.hxx:30
void SetFloatingMode(bool bFloatMode)
Definition: dockmgr.cxx:887
const Point & GetMousePosPixel() const
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:302
void RemoveUserEvent(ImplSVEvent *nUserEvent)
Definition: event.cxx:352
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
VclPtr< vcl::Window > mpWindow
Definition: event.hxx:291
bool IsShift() const
Definition: keycod.hxx:56
DockingManager * ImplGetDockingManager()
Definition: svdata.cxx:300
static bool GetDockingFloatsSupported()
#define SAL_WARN_IF(condition, area, stream)
const MouseEvent * GetMouseEvent() const
Definition: event.hxx:324
ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Definition: event.cxx:334
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
Definition: dockmgr.cxx:280
bool IsLeft() const
Definition: event.hxx:149
bool IsMod1() const
Definition: keycod.hxx:58
const Point & GetPosPixel() const
Definition: event.hxx:123
virtual void Activate()
Definition: window.cxx:1827
VclPtr< vcl::Window > mpWindow
Definition: svdata.hxx:455
WinBits const WB_TABSTOP
NotifyEvent(MouseNotifyEvent nEventType, vcl::Window *pWindow, const void *pEvent=nullptr)
Definition: event.cxx:657
static MouseEvent ImplTranslateMouseEvent(const MouseEvent &rE, vcl::Window const *pSource, vcl::Window const *pDest)
Definition: event.cxx:368
vcl::Window * getNonLayoutParent(vcl::Window *pWindow)
Definition: layout.cxx:2847
WindowType GetType() const
Definition: window2.cxx:973
const tools::Rectangle & GetDragArea() const
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:307
WinBits GetStyle() const
Definition: window2.cxx:952
SAL_DLLPRIVATE void CompatDataChanged(const DataChangedEvent &rDCEvt)
Definition: window.cxx:3885
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2792
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:218
const Wallpaper & GetBackground() const
Definition: window3.cxx:63
MouseNotifyEvent
Definition: event.hxx:275
bool isDisposed() const
AnyEventRef aEvent
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:318
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
ImplSVWinData * mpWinData
Definition: svdata.hxx:394
bool IsMod1() const
Definition: event.hxx:160