LibreOffice Module vcl (master) 1
winproc.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 <sal/config.h>
21
22#include <o3tl/safeint.hxx>
23#include <tools/debug.hxx>
24#include <tools/time.hxx>
25#include <sal/log.hxx>
26
28
30#include <comphelper/lok.hxx>
31#include <vcl/QueueInfo.hxx>
32#include <vcl/timer.hxx>
33#include <vcl/event.hxx>
37#include <vcl/settings.hxx>
38#include <vcl/svapp.hxx>
39#include <vcl/cursor.hxx>
40#include <vcl/wrkwin.hxx>
43#include <vcl/toolkit/edit.hxx>
44#include <vcl/help.hxx>
45#include <vcl/dockwin.hxx>
46#include <vcl/menu.hxx>
47#include <vcl/virdev.hxx>
48#include <vcl/uitest/logger.hxx>
49#include <vcl/ptrstyle.hxx>
50
51#include <svdata.hxx>
52#include <salwtype.hxx>
53#include <salframe.hxx>
54#include <accmgr.hxx>
55#include <print.h>
56#include <window.h>
57#include <helpwin.hxx>
58#include <brdwin.hxx>
60
61#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
62#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
63#include <com/sun/star/awt/MouseEvent.hpp>
64
65#define IMPL_MIN_NEEDSYSWIN 49
66
68{
69 return rEvt.GetWindow()->CompatPreNotify( rEvt );
70}
71
72static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePos,
73 sal_uInt16 nCode, NotifyEventType nSVEvent,
74 bool bMouseLeave )
75{
76 ImplSVData* pSVData = ImplGetSVData();
77
78 if (pSVData->mpWinData->mpFirstFloat && !pSVData->mpWinData->mpCaptureWin
80 {
81 /*
82 * #93895# since floats are system windows, coordinates have
83 * to be converted to float relative for the hittest
84 */
85 bool bHitTestInsideRect = false;
86 FloatingWindow* pFloat = pSVData->mpWinData->mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, bHitTestInsideRect );
87 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
88 {
89 if ( bMouseLeave )
90 return true;
91
92 if ( !pFloat || bHitTestInsideRect )
93 {
94 if ( ImplGetSVHelpData().mpHelpWin && !ImplGetSVHelpData().mbKeyboardHelp )
97 return true;
98 }
99 }
100 else
101 {
102 if ( nCode & MOUSE_LEFT )
103 {
104 if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
105 {
106 if ( !pFloat )
107 {
108 FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
110 return true;
111 }
112 else if ( bHitTestInsideRect )
113 {
114 pFloat->ImplSetMouseDown();
115 return true;
116 }
117 }
118 else
119 {
120 if ( pFloat )
121 {
122 if ( bHitTestInsideRect )
123 {
124 if ( pFloat->ImplIsMouseDown() )
126 return true;
127 }
128 }
129 else
130 {
131 FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
132 FloatWinPopupFlags nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
133 if ( !(nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) )
134 {
136 return true;
137 }
138 }
139 }
140 }
141 else
142 {
143 if ( !pFloat )
144 {
145 FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
146 FloatWinPopupFlags nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
147 if ( nPopupFlags & FloatWinPopupFlags::AllMouseButtonClose )
148 {
149 if ( (nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) &&
150 (nSVEvent == NotifyEventType::MOUSEBUTTONUP) )
151 return true;
153 return true;
154 }
155 else
156 return true;
157 }
158 }
159 }
160 }
161
162 return false;
163}
164
165static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMousePos )
166{
167 ImplSVHelpData& aHelpData = ImplGetSVHelpData();
168 if ( aHelpData.mpHelpWin &&
169 ( aHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
170 pChild->IsWindowOrChild( aHelpData.mpHelpWin ) ))
171 return;
172
174 if ( aHelpData.mbQuickHelp )
175 nHelpMode = HelpEventMode::QUICK;
176 if ( aHelpData.mbBalloonHelp )
177 nHelpMode |= HelpEventMode::BALLOON;
178 if ( !(bool(nHelpMode)) )
179 return;
180
181 if ( pChild->IsInputEnabled() && !pChild->IsInModalMode() )
182 {
183 HelpEvent aHelpEvent( rMousePos, nHelpMode );
184 aHelpData.mbRequestingHelp = true;
185 pChild->RequestHelp( aHelpEvent );
186 aHelpData.mbRequestingHelp = false;
187 }
188 // #104172# do not kill keyboard activated tooltips
189 else if ( aHelpData.mpHelpWin && !aHelpData.mbKeyboardHelp)
190 {
191 ImplDestroyHelpWindow( true );
192 }
193}
194
195static void ImplSetMousePointer( vcl::Window const * pChild )
196{
197 if ( ImplGetSVHelpData().mbExtHelpMode )
199 else
200 pChild->ImplGetFrame()->SetPointer( pChild->ImplGetMousePointer() );
201}
202
203static bool ImplCallCommand( const VclPtr<vcl::Window>& pChild, CommandEventId nEvt, void const * pData = nullptr,
204 bool bMouse = false, Point const * pPos = nullptr )
205{
206 Point aPos;
207 if ( pPos )
208 aPos = *pPos;
209 else
210 {
211 if( bMouse )
212 aPos = pChild->GetPointerPosPixel();
213 else
214 {
215 // simulate mouseposition at center of window
216 Size aSize( pChild->GetOutputSizePixel() );
217 aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
218 }
219 }
220
221 CommandEvent aCEvt( aPos, nEvt, bMouse, pData );
222 NotifyEvent aNCmdEvt( NotifyEventType::COMMAND, pChild, &aCEvt );
223 bool bPreNotify = ImplCallPreNotify( aNCmdEvt );
224 if ( pChild->isDisposed() )
225 return false;
226 if ( !bPreNotify )
227 {
228 pChild->ImplGetWindowImpl()->mbCommand = false;
229 pChild->Command( aCEvt );
230
231 if( pChild->isDisposed() )
232 return false;
233 pChild->ImplNotifyKeyMouseCommandEventListeners( aNCmdEvt );
234 if ( pChild->isDisposed() )
235 return false;
236 if ( pChild->ImplGetWindowImpl()->mbCommand )
237 return true;
238 }
239
240 return false;
241}
242
243/* #i34277# delayed context menu activation;
244* necessary if there already was a popup menu running.
245*/
246
247namespace {
248
249struct ContextMenuEvent
250{
251 VclPtr<vcl::Window> pWindow;
252 Point aChildPos;
253};
254
255}
256
257static void ContextMenuEventLink( void* pCEvent, void* )
258{
259 ContextMenuEvent* pEv = static_cast<ContextMenuEvent*>(pCEvent);
260
261 if( ! pEv->pWindow->isDisposed() )
262 {
263 ImplCallCommand( pEv->pWindow, CommandEventId::ContextMenu, nullptr, true, &pEv->aChildPos );
264 }
265 delete pEv;
266}
267
268bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, NotifyEventType nSVEvent, bool bMouseLeave,
269 tools::Long nX, tools::Long nY, sal_uInt64 nMsgTime,
270 sal_uInt16 nCode, MouseEventModifiers nMode )
271{
272 SAL_INFO( "vcl.debugevent",
273 "mouse event "
274 "(NotifyEventType " << static_cast<sal_uInt16>(nSVEvent) << ") "
275 "(MouseLeave " << bMouseLeave << ") "
276 "(X, Y " << nX << ", " << nY << ") "
277 "(Code " << nCode << ") "
278 "(Modifiers " << static_cast<sal_uInt16>(nMode) << ")");
279 ImplSVHelpData& aHelpData = ImplGetSVHelpData();
280 ImplSVData* pSVData = ImplGetSVData();
281 Point aMousePos( nX, nY );
282 VclPtr<vcl::Window> pChild;
283 bool bRet(false);
284 sal_uInt16 nClicks(0);
285 ImplFrameData* pWinFrameData = xWindow->ImplGetFrameData();
286 sal_uInt16 nOldCode = pWinFrameData->mnMouseCode;
287
289 && xWindow->GetOutDev() && !xWindow->GetOutDev()->ImplIsAntiparallel())
290 {
291 xWindow->GetOutDev()->ReMirror(aMousePos);
292 nX = aMousePos.X();
293 nY = aMousePos.Y();
294 }
295
296 // we need a mousemove event, before we get a mousebuttondown or a
297 // mousebuttonup event
298 if ( (nSVEvent == NotifyEventType::MOUSEBUTTONDOWN) || (nSVEvent == NotifyEventType::MOUSEBUTTONUP) )
299 {
300 if ( (nSVEvent == NotifyEventType::MOUSEBUTTONUP) && aHelpData.mbExtHelpMode )
302 if ( aHelpData.mpHelpWin )
303 {
304 if( xWindow->ImplGetWindow() == aHelpData.mpHelpWin )
305 {
306 ImplDestroyHelpWindow( false );
307 return true; // xWindow is dead now - avoid crash!
308 }
309 else
310 ImplDestroyHelpWindow( true );
311 }
312
313 if ( (pWinFrameData->mnLastMouseX != nX) ||
314 (pWinFrameData->mnLastMouseY != nY) )
315 {
316 sal_uInt16 nMoveCode = nCode & ~(MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE);
317 ImplHandleMouseEvent(xWindow, NotifyEventType::MOUSEMOVE, false, nX, nY, nMsgTime, nMoveCode, nMode);
318 }
319 }
320
321 // update frame data
322 pWinFrameData->mnBeforeLastMouseX = pWinFrameData->mnLastMouseX;
323 pWinFrameData->mnBeforeLastMouseY = pWinFrameData->mnLastMouseY;
324 pWinFrameData->mnLastMouseX = nX;
325 pWinFrameData->mnLastMouseY = nY;
326 pWinFrameData->mnMouseCode = nCode;
328 pWinFrameData->mnMouseMode = nMode & ~nTmpMask;
329 if ( bMouseLeave )
330 {
331 pWinFrameData->mbMouseIn = false;
332 if ( ImplGetSVHelpData().mpHelpWin && !ImplGetSVHelpData().mbKeyboardHelp )
333 {
334 ImplDestroyHelpWindow( true );
335
336 if ( xWindow->isDisposed() )
337 return true; // xWindow is dead now - avoid crash! (#122045#)
338 }
339 }
340 else
341 pWinFrameData->mbMouseIn = true;
342
344 || (pSVData->mpWinData->mpTrackWin == pSVData->mpWinData->mpCaptureWin),
345 "ImplHandleMouseEvent: TrackWin != CaptureWin");
346
347 // AutoScrollMode
348 if (pSVData->mpWinData->mpAutoScrollWin && (nSVEvent == NotifyEventType::MOUSEBUTTONDOWN))
349 {
351 return true;
352 }
353
354 // find mouse window
355 if (pSVData->mpWinData->mpCaptureWin)
356 {
357 pChild = pSVData->mpWinData->mpCaptureWin;
358
359 SAL_WARN_IF( xWindow != pChild->ImplGetFrameWindow(), "vcl",
360 "ImplHandleMouseEvent: mouse event is not sent to capture window" );
361
362 // java client cannot capture mouse correctly
363 if ( xWindow != pChild->ImplGetFrameWindow() )
364 return false;
365
366 if ( bMouseLeave )
367 return false;
368 }
369 else
370 {
371 if ( bMouseLeave )
372 pChild = nullptr;
373 else
374 pChild = xWindow->ImplFindWindow( aMousePos );
375 }
376
377 // test this because mouse events are buffered in the remote version
378 // and size may not be in sync
379 if ( !pChild && !bMouseLeave )
380 return false;
381
382 // execute a few tests and catch the message or implement the status
383 if ( pChild )
384 {
385 if( pChild->GetOutDev()->ImplIsAntiparallel() )
386 {
387 // re-mirror frame pos at pChild
388 const OutputDevice *pChildWinOutDev = pChild->GetOutDev();
389 pChildWinOutDev->ReMirror( aMousePos );
390 }
391
392 // no mouse messages to disabled windows
393 // #106845# if the window was disabled during capturing we have to pass the mouse events to release capturing
394 if (pSVData->mpWinData->mpCaptureWin.get() != pChild
395 && (!pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode()))
396 {
397 ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
398 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
399 {
400 ImplHandleMouseHelpRequest( pChild, aMousePos );
401 if( pWinFrameData->mpMouseMoveWin.get() != pChild )
403 }
404
405 // Call the hook also, if Window is disabled
406
407 if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
408 return true;
409 else
410 {
411 // Set normal MousePointer for disabled windows
412 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
413 ImplSetMousePointer( pChild );
414
415 return false;
416 }
417 }
418
419 // End ExtTextInput-Mode, if the user click in the same TopLevel Window
420 if (pSVData->mpWinData->mpExtTextInputWin
421 && ((nSVEvent == NotifyEventType::MOUSEBUTTONDOWN)
422 || (nSVEvent == NotifyEventType::MOUSEBUTTONUP)))
424 }
425
426 // determine mouse event data
427 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
428 {
429 // check if MouseMove belongs to same window and if the
430 // status did not change
431 if ( pChild )
432 {
433 Point aChildMousePos = pChild->ScreenToOutputPixel( aMousePos );
434 if ( !bMouseLeave &&
435 (pChild == pWinFrameData->mpMouseMoveWin) &&
436 (aChildMousePos.X() == pWinFrameData->mnLastMouseWinX) &&
437 (aChildMousePos.Y() == pWinFrameData->mnLastMouseWinY) &&
438 (nOldCode == pWinFrameData->mnMouseCode) )
439 {
440 // set mouse pointer anew, as it could have changed
441 // due to the mode switch
442 ImplSetMousePointer( pChild );
443 return false;
444 }
445
446 pWinFrameData->mnLastMouseWinX = aChildMousePos.X();
447 pWinFrameData->mnLastMouseWinY = aChildMousePos.Y();
448 }
449
450 // mouse click
451 nClicks = pWinFrameData->mnClickCount;
452
453 // call Start-Drag handler if required
454 // Warning: should be called before Move, as otherwise during
455 // fast mouse movements the applications move to the selection state
456 vcl::Window* pMouseDownWin = pWinFrameData->mpMouseDownWin;
457 if ( pMouseDownWin )
458 {
459 // check for matching StartDrag mode. We only compare
460 // the status of the mouse buttons, such that e. g. Mod1 can
461 // change immediately to the copy mode
462 const MouseSettings& rMSettings = pMouseDownWin->GetSettings().GetMouseSettings();
463 if ( (nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)) ==
465 {
466 if ( !pMouseDownWin->ImplGetFrameData()->mbStartDragCalled )
467 {
468 tools::Long nDragW = rMSettings.GetStartDragWidth();
469 tools::Long nDragH = rMSettings.GetStartDragHeight();
470 //long nMouseX = nX;
471 //long nMouseY = nY;
472 tools::Long nMouseX = aMousePos.X(); // #106074# use the possibly re-mirrored coordinates (RTL) ! nX,nY are unmodified !
473 tools::Long nMouseY = aMousePos.Y();
474 if ( (((nMouseX-nDragW) > pMouseDownWin->ImplGetFrameData()->mnFirstMouseX) ||
475 ((nMouseX+nDragW) < pMouseDownWin->ImplGetFrameData()->mnFirstMouseX)) ||
476 (((nMouseY-nDragH) > pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) ||
477 ((nMouseY+nDragH) < pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
478 {
479 pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = true;
480
481 // Check if drag source provides its own recognizer
483 {
484 // query DropTarget from child window
485 css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > xDragGestureRecognizer(
487 css::uno::UNO_QUERY );
488
489 if( xDragGestureRecognizer.is() )
490 {
491 // retrieve mouse position relative to mouse down window
492 Point relLoc = pMouseDownWin->ScreenToOutputPixel( Point(
493 pMouseDownWin->ImplGetFrameData()->mnFirstMouseX,
494 pMouseDownWin->ImplGetFrameData()->mnFirstMouseY ) );
495
496 // create a UNO mouse event out of the available data
497 css::awt::MouseEvent aMouseEvent( static_cast < css::uno::XInterface * > ( nullptr ),
498#ifdef MACOSX
499 nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3),
500#else
501 nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2),
502#endif
503 nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE),
504 nMouseX,
505 nMouseY,
506 nClicks,
507 false );
508
509 SolarMutexReleaser aReleaser;
510
511 // FIXME: where do I get Action from ?
512 css::uno::Reference< css::datatransfer::dnd::XDragSource > xDragSource = pMouseDownWin->GetDragSource();
513
514 if( xDragSource.is() )
515 {
516 static_cast < DNDListenerContainer * > ( xDragGestureRecognizer.get() )->fireDragGestureEvent( 0,
517 relLoc.X(), relLoc.Y(), xDragSource, css::uno::Any( aMouseEvent ) );
518 }
519 }
520 }
521 }
522 }
523 }
524 else
525 pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = true;
526 }
527
528 if (xWindow->isDisposed())
529 return true;
530 // test for mouseleave and mouseenter
531 VclPtr<vcl::Window> pMouseMoveWin = pWinFrameData->mpMouseMoveWin;
532 if ( pChild != pMouseMoveWin )
533 {
534 if ( pMouseMoveWin )
535 {
536 Point aLeaveMousePos = pMouseMoveWin->ScreenToOutputPixel( aMousePos );
537 MouseEvent aMLeaveEvt( aLeaveMousePos, nClicks, nMode | MouseEventModifiers::LEAVEWINDOW, nCode, nCode );
538 NotifyEvent aNLeaveEvt( NotifyEventType::MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt );
539 pWinFrameData->mbInMouseMove = true;
540 pMouseMoveWin->ImplGetWinData()->mbMouseOver = false;
541
542 // A MouseLeave can destroy this window
543 if ( !ImplCallPreNotify( aNLeaveEvt ) )
544 {
545 pMouseMoveWin->MouseMove( aMLeaveEvt );
546 if( !pMouseMoveWin->isDisposed() )
547 aNLeaveEvt.GetWindow()->ImplNotifyKeyMouseCommandEventListeners( aNLeaveEvt );
548 }
549
550 pWinFrameData->mpMouseMoveWin = nullptr;
551 pWinFrameData->mbInMouseMove = false;
552
553 if ( pChild && pChild->isDisposed() )
554 pChild = nullptr;
555 if ( pMouseMoveWin->isDisposed() )
556 return true;
557 }
558
560 }
561 pWinFrameData->mpMouseMoveWin = pChild;
562 if( pChild )
563 pChild->ImplGetWinData()->mbMouseOver = true;
564
565 // MouseLeave
566 if ( !pChild )
567 return false;
568 }
569 else
570 {
571 if (pChild)
572 {
573 // mouse click
574 if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
575 {
576 const MouseSettings& rMSettings = pChild->GetSettings().GetMouseSettings();
577 sal_uInt64 nDblClkTime = rMSettings.GetDoubleClickTime();
578 tools::Long nDblClkW = rMSettings.GetDoubleClickWidth();
579 tools::Long nDblClkH = rMSettings.GetDoubleClickHeight();
580 //long nMouseX = nX;
581 //long nMouseY = nY;
582 tools::Long nMouseX = aMousePos.X(); // #106074# use the possibly re-mirrored coordinates (RTL) ! nX,nY are unmodified !
583 tools::Long nMouseY = aMousePos.Y();
584
585 if ( (pChild == pChild->ImplGetFrameData()->mpMouseDownWin) &&
586 (nCode == pChild->ImplGetFrameData()->mnFirstMouseCode) &&
587 ((nMsgTime-pChild->ImplGetFrameData()->mnMouseDownTime) < nDblClkTime) &&
588 ((nMouseX-nDblClkW) <= pChild->ImplGetFrameData()->mnFirstMouseX) &&
589 ((nMouseX+nDblClkW) >= pChild->ImplGetFrameData()->mnFirstMouseX) &&
590 ((nMouseY-nDblClkH) <= pChild->ImplGetFrameData()->mnFirstMouseY) &&
591 ((nMouseY+nDblClkH) >= pChild->ImplGetFrameData()->mnFirstMouseY) )
592 {
593 pChild->ImplGetFrameData()->mnClickCount++;
594 pChild->ImplGetFrameData()->mbStartDragCalled = true;
595 }
596 else
597 {
598 pChild->ImplGetFrameData()->mpMouseDownWin = pChild;
599 pChild->ImplGetFrameData()->mnClickCount = 1;
600 pChild->ImplGetFrameData()->mnFirstMouseX = nMouseX;
601 pChild->ImplGetFrameData()->mnFirstMouseY = nMouseY;
602 pChild->ImplGetFrameData()->mnFirstMouseCode = nCode;
605 }
606 pChild->ImplGetFrameData()->mnMouseDownTime = nMsgTime;
607 }
608 nClicks = pChild->ImplGetFrameData()->mnClickCount;
609 }
610
612 }
613
614 SAL_WARN_IF( !pChild, "vcl", "ImplHandleMouseEvent: pChild == NULL" );
615
616 if (!pChild)
617 return false;
618
619 // create mouse event
620 Point aChildPos = pChild->ScreenToOutputPixel( aMousePos );
621 MouseEvent aMEvt( aChildPos, nClicks, nMode, nCode, nCode );
622
623
624 // tracking window gets the mouse events
625 if (pSVData->mpWinData->mpTrackWin)
626 pChild = pSVData->mpWinData->mpTrackWin;
627
628 // handle FloatingMode
629 if (!pSVData->mpWinData->mpTrackWin && pSVData->mpWinData->mpFirstFloat)
630 {
631 if ( ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ) )
632 {
633 if ( !pChild->isDisposed() )
634 {
635 pChild->ImplGetFrameData()->mbStartDragCalled = true;
636 }
637 return true;
638 }
639 }
640
641 // call handler
642 bool bCallHelpRequest = true;
643 SAL_WARN_IF( !pChild, "vcl", "ImplHandleMouseEvent: pChild is NULL" );
644
645 if (!pChild)
646 return false;
647
648 NotifyEvent aNEvt( nSVEvent, pChild, &aMEvt );
649 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
650 pChild->ImplGetFrameData()->mbInMouseMove = true;
651
652 // bring window into foreground on mouseclick
653 if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
654 {
655 if (!pSVData->mpWinData->mpFirstFloat
656 && // totop for floating windows in popup would change the focus and would close them immediately
657 !(pChild->ImplGetFrameWindow()->GetStyle()
658 & WB_OWNERDRAWDECORATION)) // ownerdrawdecorated windows must never grab focus
659 pChild->ToTop();
660 if ( pChild->isDisposed() )
661 return true;
662 }
663
664 if ( ImplCallPreNotify( aNEvt ) || pChild->isDisposed() )
665 bRet = true;
666 else
667 {
668 bRet = false;
669 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
670 {
671 if (pSVData->mpWinData->mpTrackWin)
672 {
673 TrackingEvent aTEvt( aMEvt );
674 pChild->Tracking( aTEvt );
675 if ( !pChild->isDisposed() )
676 {
677 // When ScrollRepeat, we restart the timer
678 if (pSVData->mpWinData->mpTrackTimer
680 pSVData->mpWinData->mpTrackTimer->Start();
681 }
682 bCallHelpRequest = false;
683 bRet = true;
684 }
685 else
686 {
687 if( pChild->isDisposed() )
688 bCallHelpRequest = false;
689 else
690 {
691 // if the MouseMove handler changes the help window's visibility
692 // the HelpRequest handler should not be called anymore
693 vcl::Window* pOldHelpTextWin = ImplGetSVHelpData().mpHelpWin;
694 pChild->MouseMove( aMEvt );
695 if ( pOldHelpTextWin != ImplGetSVHelpData().mpHelpWin )
696 bCallHelpRequest = false;
697 }
698 }
699 }
700 else if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
701 {
702 if ( pSVData->mpWinData->mpTrackWin )
703 bRet = true;
704 else
705 {
706 pChild->ImplGetWindowImpl()->mbMouseButtonDown = false;
707 pChild->MouseButtonDown( aMEvt );
708 }
709 }
710 else
711 {
712 if (pSVData->mpWinData->mpTrackWin)
713 {
714 pChild->EndTracking();
715 bRet = true;
716 }
717 else
718 {
719 pChild->ImplGetWindowImpl()->mbMouseButtonUp = false;
720 pChild->MouseButtonUp( aMEvt );
721 }
722 }
723
724 assert(aNEvt.GetWindow() == pChild);
725
726 if (!pChild->isDisposed())
728 }
729
730 if (pChild->isDisposed())
731 return true;
732
733 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
734 pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = false;
735
736 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
737 {
738 if ( bCallHelpRequest && !ImplGetSVHelpData().mbKeyboardHelp )
739 ImplHandleMouseHelpRequest( pChild, pChild->OutputToScreenPixel( aMEvt.GetPosPixel() ) );
740 bRet = true;
741 }
742 else if ( !bRet )
743 {
744 if ( nSVEvent == NotifyEventType::MOUSEBUTTONDOWN )
745 {
746 if ( !pChild->ImplGetWindowImpl()->mbMouseButtonDown )
747 bRet = true;
748 }
749 else
750 {
751 if ( !pChild->ImplGetWindowImpl()->mbMouseButtonUp )
752 bRet = true;
753 }
754 }
755
756 if ( nSVEvent == NotifyEventType::MOUSEMOVE )
757 {
758 // set new mouse pointer
759 if ( !bMouseLeave )
760 ImplSetMousePointer( pChild );
761 }
762 else if ( (nSVEvent == NotifyEventType::MOUSEBUTTONDOWN) || (nSVEvent == NotifyEventType::MOUSEBUTTONUP) )
763 {
764 // Command-Events
765 if ( (nClicks == 1) && (nSVEvent == NotifyEventType::MOUSEBUTTONDOWN) &&
766 (nCode == MOUSE_MIDDLE) )
767 {
769 if ( nMiddleAction == MouseMiddleButtonAction::AutoScroll )
770 bRet = !ImplCallCommand( pChild, CommandEventId::StartAutoScroll, nullptr, true, &aChildPos );
771 else if ( nMiddleAction == MouseMiddleButtonAction::PasteSelection )
772 bRet = !ImplCallCommand( pChild, CommandEventId::PasteSelection, nullptr, true, &aChildPos );
773 }
774 else
775 {
776 // ContextMenu
777 if ( (nCode == MouseSettings::GetContextMenuCode()) &&
779 {
780 bool bContextMenu = (nSVEvent == NotifyEventType::MOUSEBUTTONDOWN);
781 if ( bContextMenu )
782 {
783 if( pSVData->maAppData.mpActivePopupMenu )
784 {
785 /* #i34277# there already is a context menu open
786 * that was probably just closed with EndPopupMode.
787 * We need to give the eventual corresponding
788 * PopupMenu::Execute a chance to end properly.
789 * Therefore delay context menu command and
790 * issue only after popping one frame of the
791 * Yield stack.
792 */
793 ContextMenuEvent* pEv = new ContextMenuEvent;
794 pEv->pWindow = pChild;
795 pEv->aChildPos = aChildPos;
797 }
798 else
799 bRet = ! ImplCallCommand( pChild, CommandEventId::ContextMenu, nullptr, true, &aChildPos );
800 }
801 }
802 }
803 }
804
805 return bRet;
806}
807
808bool ImplLOKHandleMouseEvent(const VclPtr<vcl::Window>& xWindow, NotifyEventType nEvent, bool /*bMouseLeave*/,
809 tools::Long nX, tools::Long nY, sal_uInt64 /*nMsgTime*/,
810 sal_uInt16 nCode, MouseEventModifiers nMode, sal_uInt16 nClicks)
811{
812 Point aMousePos(nX, nY);
813
814 if (!xWindow)
815 return false;
816
817 if (xWindow->isDisposed())
818 return false;
819
820 ImplFrameData* pFrameData = xWindow->ImplGetFrameData();
821 if (!pFrameData)
822 return false;
823
824 Point aWinPos = xWindow->ScreenToOutputPixel(aMousePos);
825
826 pFrameData->mnLastMouseX = nX;
827 pFrameData->mnLastMouseY = nY;
828 pFrameData->mnClickCount = nClicks;
829 pFrameData->mnMouseCode = nCode;
830 pFrameData->mbMouseIn = false;
831
832 vcl::Window* pDragWin = pFrameData->mpMouseDownWin;
833 if (pDragWin &&
834 nEvent == NotifyEventType::MOUSEMOVE &&
835 pFrameData->mbDragging)
836 {
837 css::uno::Reference<css::datatransfer::dnd::XDropTargetDragContext> xDropTargetDragContext =
839 css::uno::Reference<css::datatransfer::dnd::XDropTarget> xDropTarget(
840 pDragWin->ImplGetWindowImpl()->mxDNDListenerContainer, css::uno::UNO_QUERY);
841
842 if (!xDropTarget.is() ||
843 !xDropTargetDragContext.is() ||
844 (nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)) !=
846 {
847 pFrameData->mbStartDragCalled = pFrameData->mbDragging = false;
848 return false;
849 }
850
851 static_cast<DNDListenerContainer *>(xDropTarget.get())->fireDragOverEvent(
852 xDropTargetDragContext,
853 css::datatransfer::dnd::DNDConstants::ACTION_MOVE,
854 aWinPos.X(),
855 aWinPos.Y(),
856 (css::datatransfer::dnd::DNDConstants::ACTION_COPY |
857 css::datatransfer::dnd::DNDConstants::ACTION_MOVE |
858 css::datatransfer::dnd::DNDConstants::ACTION_LINK));
859
860 return true;
861 }
862
863 if (pDragWin &&
865 pFrameData->mbDragging)
866 {
867 css::uno::Reference<css::datatransfer::XTransferable> xTransfer;
868 css::uno::Reference<css::datatransfer::dnd::XDropTargetDropContext> xDropTargetDropContext =
870 css::uno::Reference<css::datatransfer::dnd::XDropTarget> xDropTarget(
871 pDragWin->ImplGetWindowImpl()->mxDNDListenerContainer, css::uno::UNO_QUERY);
872
873 if (!xDropTarget.is() || !xDropTargetDropContext.is())
874 {
875 pFrameData->mbStartDragCalled = pFrameData->mbDragging = false;
876 return false;
877 }
878
879 Point dragOverPos = pDragWin->ScreenToOutputPixel(aMousePos);
880 static_cast<DNDListenerContainer *>(xDropTarget.get())->fireDropEvent(
881 xDropTargetDropContext,
882 css::datatransfer::dnd::DNDConstants::ACTION_MOVE,
883 dragOverPos.X(),
884 dragOverPos.Y(),
885 (css::datatransfer::dnd::DNDConstants::ACTION_COPY |
886 css::datatransfer::dnd::DNDConstants::ACTION_MOVE |
887 css::datatransfer::dnd::DNDConstants::ACTION_LINK),
888 xTransfer);
889
890 pFrameData->mbStartDragCalled = pFrameData->mbDragging = false;
891 return true;
892 }
893
894 if (pFrameData->mbDragging)
895 {
896 // wrong status, reset
897 pFrameData->mbStartDragCalled = pFrameData->mbDragging = false;
898 return false;
899 }
900
901 vcl::Window* pDownWin = pFrameData->mpMouseDownWin;
902 if (pDownWin && nEvent == NotifyEventType::MOUSEMOVE)
903 {
904 const MouseSettings& aSettings = pDownWin->GetSettings().GetMouseSettings();
905 if ((nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)) ==
907 {
908 if (!pFrameData->mbStartDragCalled)
909 {
910 tools::Long nDragWidth = aSettings.GetStartDragWidth();
911 tools::Long nDragHeight = aSettings.GetStartDragHeight();
912 tools::Long nMouseX = aMousePos.X();
913 tools::Long nMouseY = aMousePos.Y();
914
915 if ((((nMouseX - nDragWidth) > pFrameData->mnFirstMouseX) ||
916 ((nMouseX + nDragWidth) < pFrameData->mnFirstMouseX)) ||
917 (((nMouseY - nDragHeight) > pFrameData->mnFirstMouseY) ||
918 ((nMouseY + nDragHeight) < pFrameData->mnFirstMouseY)))
919 {
920 pFrameData->mbStartDragCalled = true;
921
922 if (pFrameData->mbInternalDragGestureRecognizer)
923 {
924 // query DropTarget from child window
925 css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > xDragGestureRecognizer(
927 css::uno::UNO_QUERY );
928
929 if (xDragGestureRecognizer.is())
930 {
931 // create a UNO mouse event out of the available data
932 css::awt::MouseEvent aEvent(
933 static_cast < css::uno::XInterface * > ( nullptr ),
934 #ifdef MACOSX
935 nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3),
936 #else
937 nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2),
938 #endif
939 nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE),
940 nMouseX,
941 nMouseY,
942 nClicks,
943 false);
944 css::uno::Reference< css::datatransfer::dnd::XDragSource > xDragSource =
945 pDownWin->GetDragSource();
946
947 if (xDragSource.is())
948 {
949 static_cast<DNDListenerContainer *>(xDragGestureRecognizer.get())->
950 fireDragGestureEvent(
951 0,
952 aWinPos.X(),
953 aWinPos.Y(),
954 xDragSource,
955 css::uno::Any(aEvent));
956 }
957 }
958 }
959 }
960 }
961 }
962 }
963
964 MouseEvent aMouseEvent(aWinPos, nClicks, nMode, nCode, nCode);
965 if (nEvent == NotifyEventType::MOUSEMOVE)
966 {
967 if (pFrameData->mpTrackWin)
968 {
969 TrackingEvent aTrackingEvent(aMouseEvent);
970 pFrameData->mpTrackWin->Tracking(aTrackingEvent);
971 }
972 else
973 xWindow->MouseMove(aMouseEvent);
974 }
975 else if (nEvent == NotifyEventType::MOUSEBUTTONDOWN &&
976 !pFrameData->mpTrackWin)
977 {
978 pFrameData->mpMouseDownWin = xWindow;
979 pFrameData->mnFirstMouseX = aMousePos.X();
980 pFrameData->mnFirstMouseY = aMousePos.Y();
981
982 xWindow->MouseButtonDown(aMouseEvent);
983 }
984 else
985 {
986 if (pFrameData->mpTrackWin)
987 {
988 pFrameData->mpTrackWin->EndTracking();
989 }
990
991 pFrameData->mpMouseDownWin = nullptr;
992 pFrameData->mpMouseMoveWin = nullptr;
993 pFrameData->mbStartDragCalled = false;
994 xWindow->MouseButtonUp(aMouseEvent);
995 }
996
998 {
999 // ContextMenu
1000 if ( (nCode == MouseSettings::GetContextMenuCode()) &&
1002 {
1003 ImplCallCommand(xWindow, CommandEventId::ContextMenu, nullptr, true, &aWinPos);
1004 }
1005 }
1006
1007 return true;
1008}
1009
1011{
1012 ImplSVData* pSVData = ImplGetSVData();
1013
1014 // determine last input time
1016
1017 // #127104# workaround for destroyed windows
1018 if( pWindow->ImplGetWindowImpl() == nullptr )
1019 return nullptr;
1020
1021 // find window - is every time the window which has currently the
1022 // focus or the last time the focus.
1023
1024 // the first floating window always has the focus, try it, or any parent floating windows, first
1025 vcl::Window* pChild = pSVData->mpWinData->mpFirstFloat;
1026 while (pChild)
1027 {
1028 if (pChild->ImplGetWindowImpl())
1029 {
1030 if (pChild->ImplGetWindowImpl()->mbFloatWin)
1031 {
1032 if (static_cast<FloatingWindow *>(pChild)->GrabsFocus())
1033 break;
1034 }
1035 else if (pChild->ImplGetWindowImpl()->mbDockWin)
1036 {
1038 if (pParent && pParent->ImplGetWindowImpl()->mbFloatWin &&
1039 static_cast<FloatingWindow *>(pParent)->GrabsFocus())
1040 break;
1041 }
1042 }
1043 pChild = pChild->GetParent();
1044 }
1045
1046 if (!pChild)
1047 pChild = pWindow;
1048
1049 pChild = pChild->ImplGetWindowImpl() && pChild->ImplGetWindowImpl()->mpFrameData ? pChild->ImplGetWindowImpl()->mpFrameData->mpFocusWin.get() : nullptr;
1050
1051 // no child - then no input
1052 if ( !pChild )
1053 return nullptr;
1054
1055 // We call also KeyInput if we haven't the focus, because on Unix
1056 // system this is often the case when a Lookup Choice Window has
1057 // the focus - because this windows send the KeyInput directly to
1058 // the window without resetting the focus
1059
1060 // no keyinput to disabled windows
1061 if ( !pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode() )
1062 return nullptr;
1063
1064 return pChild;
1065}
1066
1067static bool ImplHandleKey( vcl::Window* pWindow, NotifyEventType nSVEvent,
1068 sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, bool bForward )
1069{
1070 ImplSVData* pSVData = ImplGetSVData();
1071 vcl::KeyCode aKeyCode( nKeyCode, nKeyCode );
1072 sal_uInt16 nEvCode = aKeyCode.GetCode();
1073
1074 // allow application key listeners to remove the key event
1075 // but make sure we're not forwarding external KeyEvents, (ie where bForward is false)
1076 // because those are coming back from the listener itself and MUST be processed
1077 if( bForward )
1078 {
1079 VclEventId nVCLEvent;
1080 switch( nSVEvent )
1081 {
1083 nVCLEvent = VclEventId::WindowKeyInput;
1084 break;
1086 nVCLEvent = VclEventId::WindowKeyUp;
1087 break;
1088 default:
1089 nVCLEvent = VclEventId::NONE;
1090 break;
1091 }
1092 KeyEvent aKeyEvent(static_cast<sal_Unicode>(nCharCode), aKeyCode, nRepeat);
1093 if (nVCLEvent != VclEventId::NONE && Application::HandleKey(nVCLEvent, pWindow, &aKeyEvent))
1094 return true;
1095 }
1096
1097 bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
1098
1099 // determine last input time
1101
1102 // handle tracking window
1103 if ( nSVEvent == NotifyEventType::KEYINPUT )
1104 {
1105 if ( ImplGetSVHelpData().mbExtHelpMode )
1106 {
1108 if ( nEvCode == KEY_ESCAPE )
1109 return true;
1110 }
1111 if ( ImplGetSVHelpData().mpHelpWin )
1112 ImplDestroyHelpWindow( false );
1113
1114 // AutoScrollMode
1115 if (pSVData->mpWinData->mpAutoScrollWin)
1116 {
1118 if ( nEvCode == KEY_ESCAPE )
1119 return true;
1120 }
1121
1122 if (pSVData->mpWinData->mpTrackWin)
1123 {
1124 sal_uInt16 nOrigCode = aKeyCode.GetCode();
1125
1126 if ( nOrigCode == KEY_ESCAPE )
1127 {
1129 if (pSVData->mpWinData->mpFirstFloat)
1130 {
1131 FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
1132 if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
1133 {
1134 sal_uInt16 nEscCode = aKeyCode.GetCode();
1135
1136 if ( nEscCode == KEY_ESCAPE )
1138 }
1139 }
1140 return true;
1141 }
1142 else if ( nOrigCode == KEY_RETURN )
1143 {
1145 return true;
1146 }
1147 else
1148 return true;
1149 }
1150
1151 // handle FloatingMode
1152 if (pSVData->mpWinData->mpFirstFloat)
1153 {
1154 FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
1155 if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
1156 {
1157 sal_uInt16 nCode = aKeyCode.GetCode();
1158
1159 if ( (nCode == KEY_ESCAPE) || bCtrlF6)
1160 {
1162 if( !bCtrlF6 )
1163 return true;
1164 }
1165 }
1166 }
1167
1168 // test for accel
1169 if ( pSVData->maAppData.mpAccelMgr )
1170 {
1171 if ( pSVData->maAppData.mpAccelMgr->IsAccelKey( aKeyCode ) )
1172 return true;
1173 }
1174 }
1175
1176 // find window
1177 VclPtr<vcl::Window> pChild = ImplGetKeyInputWindow( pWindow );
1178 if ( !pChild )
1179 return false;
1180
1181 // #i1820# use locale specific decimal separator
1182 if (nEvCode == KEY_DECIMAL)
1183 {
1184 // tdf#138932: don't modify the meaning of the key for password box
1185 bool bPass = false;
1186 if (auto pEdit = dynamic_cast<Edit*>(pChild.get()))
1187 bPass = pEdit->IsPassword();
1188 if (!bPass && Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep())
1189 {
1190 OUString aSep(pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep());
1191 nCharCode = static_cast<sal_uInt16>(aSep[0]);
1192 }
1193 }
1194
1195 // RTL: mirror cursor keys
1196 if( (aKeyCode.GetCode() == KEY_LEFT || aKeyCode.GetCode() == KEY_RIGHT) &&
1197 pChild->IsRTLEnabled() && pChild->GetOutDev()->HasMirroredGraphics() )
1198 aKeyCode = vcl::KeyCode( aKeyCode.GetCode() == KEY_LEFT ? KEY_RIGHT : KEY_LEFT, aKeyCode.GetModifier() );
1199
1200 KeyEvent aKeyEvt( static_cast<sal_Unicode>(nCharCode), aKeyCode, nRepeat );
1201 NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt );
1202 bool bKeyPreNotify = ImplCallPreNotify( aNotifyEvt );
1203 bool bRet = true;
1204
1205 if ( !bKeyPreNotify && !pChild->isDisposed() )
1206 {
1207 if ( nSVEvent == NotifyEventType::KEYINPUT )
1208 {
1209 UITestLogger::getInstance().logKeyInput(pChild, aKeyEvt);
1210 pChild->ImplGetWindowImpl()->mbKeyInput = false;
1211 pChild->KeyInput( aKeyEvt );
1212 }
1213 else
1214 {
1215 pChild->ImplGetWindowImpl()->mbKeyUp = false;
1216 pChild->KeyUp( aKeyEvt );
1217 }
1218 if( !pChild->isDisposed() )
1219 aNotifyEvt.GetWindow()->ImplNotifyKeyMouseCommandEventListeners( aNotifyEvt );
1220 }
1221
1222 if ( pChild->isDisposed() )
1223 return true;
1224
1225 if ( nSVEvent == NotifyEventType::KEYINPUT )
1226 {
1227 if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyInput )
1228 {
1229 sal_uInt16 nCode = aKeyCode.GetCode();
1230
1231 // #101999# is focus in or below toolbox
1232 bool bToolboxFocus=false;
1233 if( (nCode == KEY_F1) && aKeyCode.IsShift() )
1234 {
1236 while( pWin )
1237 {
1238 if( pWin->ImplGetWindowImpl()->mbToolBox )
1239 {
1240 bToolboxFocus = true;
1241 break;
1242 }
1243 else
1244 pWin = pWin->GetParent();
1245 }
1246 }
1247
1248 // ContextMenu
1249 if ( (nCode == KEY_CONTEXTMENU) || ((nCode == KEY_F10) && aKeyCode.IsShift() && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) )
1251 else if ( ( (nCode == KEY_F2) && aKeyCode.IsShift() ) || ( (nCode == KEY_F1) && aKeyCode.IsMod1() ) ||
1252 // #101999# no active help when focus in toolbox, simulate BalloonHelp instead
1253 ( (nCode == KEY_F1) && aKeyCode.IsShift() && bToolboxFocus ) )
1254 {
1255 // TipHelp via Keyboard (Shift-F2 or Ctrl-F1)
1256 // simulate mouseposition at center of window
1257
1258 Size aSize = pChild->GetOutDev()->GetOutputSize();
1259 Point aPos( aSize.getWidth()/2, aSize.getHeight()/2 );
1260 aPos = pChild->OutputToScreenPixel( aPos );
1261
1262 HelpEvent aHelpEvent( aPos, HelpEventMode::BALLOON );
1263 aHelpEvent.SetKeyboardActivated( true );
1265 pChild->RequestHelp( aHelpEvent );
1267 }
1268 else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) )
1269 {
1270 if ( !aKeyCode.GetModifier() )
1271 {
1272 if ( ImplGetSVHelpData().mbContextHelp )
1273 {
1274 Point aMousePos = pChild->OutputToScreenPixel( pChild->GetPointerPosPixel() );
1275 HelpEvent aHelpEvent( aMousePos, HelpEventMode::CONTEXT );
1276 pChild->RequestHelp( aHelpEvent );
1277 }
1278 else
1279 bRet = false;
1280 }
1281 else if ( aKeyCode.IsShift() )
1282 {
1283 if ( ImplGetSVHelpData().mbExtHelp )
1285 else
1286 bRet = false;
1287 }
1288 }
1289 else
1290 bRet = false;
1291 }
1292 }
1293 else
1294 {
1295 if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyUp )
1296 bRet = false;
1297 }
1298
1299 // #105591# send keyinput to parent if we are a floating window and the key was not processed yet
1300 if( !bRet && pWindow->ImplGetWindowImpl() && pWindow->ImplGetWindowImpl()->mbFloatWin && pWindow->GetParent() && (pWindow->ImplGetWindowImpl()->mpFrame != pWindow->GetParent()->ImplGetWindowImpl()->mpFrame) )
1301 {
1302 pChild = pWindow->GetParent();
1303
1304 // call handler
1305 NotifyEvent aNEvt( nSVEvent, pChild, &aKeyEvt );
1306 bool bPreNotify = ImplCallPreNotify( aNEvt );
1307 if ( pChild->isDisposed() )
1308 return true;
1309
1310 if ( !bPreNotify )
1311 {
1312 if ( nSVEvent == NotifyEventType::KEYINPUT )
1313 {
1314 pChild->ImplGetWindowImpl()->mbKeyInput = false;
1315 pChild->KeyInput( aKeyEvt );
1316 }
1317 else
1318 {
1319 pChild->ImplGetWindowImpl()->mbKeyUp = false;
1320 pChild->KeyUp( aKeyEvt );
1321 }
1322
1323 if( !pChild->isDisposed() )
1325 if ( pChild->isDisposed() )
1326 return true;
1327 }
1328
1329 if( bPreNotify || !pChild->ImplGetWindowImpl()->mbKeyInput )
1330 bRet = true;
1331 }
1332
1333 return bRet;
1334}
1335
1337 const OUString& rText,
1338 const ExtTextInputAttr* pTextAttr,
1339 sal_Int32 nCursorPos, sal_uInt16 nCursorFlags )
1340{
1341 ImplSVData* pSVData = ImplGetSVData();
1342 vcl::Window* pChild = nullptr;
1343
1344 int nTries = 200;
1345 while( nTries-- )
1346 {
1347 pChild = pSVData->mpWinData->mpExtTextInputWin;
1348 if ( !pChild )
1349 {
1350 pChild = ImplGetKeyInputWindow( pWindow );
1351 if ( !pChild )
1352 return false;
1353 }
1354 if( !pChild->ImplGetWindowImpl()->mpFrameData->mnFocusId )
1355 break;
1356
1358 {
1359 SAL_WARN("vcl", "Failed to get ext text input context");
1360 break;
1361 }
1363 }
1364
1365 // If it is the first ExtTextInput call, we inform the information
1366 // and allocate the data, which we must store in this mode
1367 ImplWinData* pWinData = pChild->ImplGetWinData();
1368 if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
1369 {
1370 pChild->ImplGetWindowImpl()->mbExtTextInput = true;
1371 pWinData->mpExtOldText = OUString();
1372 pWinData->mpExtOldAttrAry.reset();
1373 pSVData->mpWinData->mpExtTextInputWin = pChild;
1375 }
1376
1377 // be aware of being recursively called in StartExtTextInput
1378 if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
1379 return false;
1380
1381 // Test for changes
1382 bool bOnlyCursor = false;
1383 sal_Int32 nMinLen = std::min( pWinData->mpExtOldText->getLength(), rText.getLength() );
1384 sal_Int32 nDeltaStart = 0;
1385 while ( nDeltaStart < nMinLen )
1386 {
1387 if ( (*pWinData->mpExtOldText)[nDeltaStart] != rText[nDeltaStart] )
1388 break;
1389 nDeltaStart++;
1390 }
1391 if ( pWinData->mpExtOldAttrAry || pTextAttr )
1392 {
1393 if ( !pWinData->mpExtOldAttrAry || !pTextAttr )
1394 nDeltaStart = 0;
1395 else
1396 {
1397 sal_Int32 i = 0;
1398 while ( i < nDeltaStart )
1399 {
1400 if ( pWinData->mpExtOldAttrAry[i] != pTextAttr[i] )
1401 {
1402 nDeltaStart = i;
1403 break;
1404 }
1405 i++;
1406 }
1407 }
1408 }
1409 if ( (nDeltaStart >= nMinLen) &&
1410 (pWinData->mpExtOldText->getLength() == rText.getLength()) )
1411 bOnlyCursor = true;
1412
1413 // Call Event and store the information
1414 CommandExtTextInputData aData( rText, pTextAttr,
1415 nCursorPos, nCursorFlags,
1416 bOnlyCursor );
1417 *pWinData->mpExtOldText = rText;
1418 pWinData->mpExtOldAttrAry.reset();
1419 if ( pTextAttr )
1420 {
1421 pWinData->mpExtOldAttrAry.reset( new ExtTextInputAttr[rText.getLength()] );
1422 memcpy( pWinData->mpExtOldAttrAry.get(), pTextAttr, rText.getLength()*sizeof( ExtTextInputAttr ) );
1423 }
1425}
1426
1428{
1429 ImplSVData* pSVData = ImplGetSVData();
1430 vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
1431 bool bRet = false;
1432
1433 if ( pChild )
1434 {
1435 pChild->ImplGetWindowImpl()->mbExtTextInput = false;
1436 pSVData->mpWinData->mpExtTextInputWin = nullptr;
1437 ImplWinData* pWinData = pChild->ImplGetWinData();
1438 pWinData->mpExtOldText.reset();
1439 pWinData->mpExtOldAttrAry.reset();
1441 }
1442
1443 return bRet;
1444}
1445
1447 tools::Rectangle& rRect, tools::Long& rInputWidth,
1448 bool * pVertical )
1449{
1450 ImplSVData* pSVData = ImplGetSVData();
1451 vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
1452
1453 if ( !pChild )
1454 pChild = ImplGetKeyInputWindow( pWindow );
1455 else
1456 {
1457 // Test, if the Window is related to the frame
1458 if ( !pWindow->ImplIsWindowOrChild( pChild ) )
1459 pChild = ImplGetKeyInputWindow( pWindow );
1460 }
1461
1462 if ( pChild )
1463 {
1464 const OutputDevice *pChildOutDev = pChild->GetOutDev();
1466 const tools::Rectangle* pRect = pChild->GetCursorRect();
1467 if ( pRect )
1468 rRect = pChildOutDev->ImplLogicToDevicePixel( *pRect );
1469 else
1470 {
1471 vcl::Cursor* pCursor = pChild->GetCursor();
1472 if ( pCursor )
1473 {
1474 Point aPos = pChildOutDev->ImplLogicToDevicePixel( pCursor->GetPos() );
1475 Size aSize = pChild->LogicToPixel( pCursor->GetSize() );
1476 if ( !aSize.Width() )
1477 aSize.setWidth( pChild->GetSettings().GetStyleSettings().GetCursorSize() );
1478 rRect = tools::Rectangle( aPos, aSize );
1479 }
1480 else
1481 rRect = tools::Rectangle( Point( pChild->GetOutOffXPixel(), pChild->GetOutOffYPixel() ), Size() );
1482 }
1483 rInputWidth = pChild->GetOutDev()->ImplLogicWidthToDevicePixel( pChild->GetCursorExtTextInputWidth() );
1484 if ( !rInputWidth )
1485 rInputWidth = rRect.GetWidth();
1486 }
1487 if (pVertical != nullptr)
1488 *pVertical
1489 = pChild != nullptr && pChild->GetInputContext().GetFont().IsVertical();
1490}
1491
1493{
1494 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
1497}
1498
1499static bool ImplCallWheelCommand( const VclPtr<vcl::Window>& pWindow, const Point& rPos,
1500 const CommandWheelData* pWheelData )
1501{
1502 Point aCmdMousePos = pWindow->ScreenToOutputPixel( rPos );
1503 CommandEvent aCEvt( aCmdMousePos, CommandEventId::Wheel, true, pWheelData );
1504 NotifyEvent aNCmdEvt( NotifyEventType::COMMAND, pWindow, &aCEvt );
1505 bool bPreNotify = ImplCallPreNotify( aNCmdEvt );
1506 if ( pWindow->isDisposed() )
1507 return false;
1508 if ( !bPreNotify )
1509 {
1510 pWindow->ImplGetWindowImpl()->mbCommand = false;
1511 pWindow->Command( aCEvt );
1512 if ( pWindow->isDisposed() )
1513 return false;
1514 if ( pWindow->ImplGetWindowImpl()->mbCommand )
1515 return true;
1516 }
1517 return false;
1518}
1519
1520static bool acceptableWheelScrollTarget(const vcl::Window *pMouseWindow)
1521{
1522 return (pMouseWindow && !pMouseWindow->isDisposed() && pMouseWindow->IsInputEnabled() && !pMouseWindow->IsInModalMode());
1523}
1524
1525//If the last event at the same absolute screen position was handled by a
1526//different window then reuse that window if the event occurs within 1/2 a
1527//second, i.e. so scrolling down something like the calc sidebar that contains
1528//widgets that respond to wheel events will continue to send the event to the
1529//scrolling widget in favour of the widget that happens to end up under the
1530//mouse.
1532{
1533 return (rEvt.mnX == rPrevEvt.mnX && rEvt.mnY == rPrevEvt.mnY && rEvt.mnTime-rPrevEvt.mnTime < 500/*ms*/);
1534}
1535
1536namespace {
1537
1538class HandleGestureEventBase
1539{
1540protected:
1541 ImplSVData* m_pSVData;
1542 VclPtr<vcl::Window> m_pWindow;
1543 Point m_aMousePos;
1544
1545public:
1546 HandleGestureEventBase(vcl::Window *pWindow, const Point &rMousePos)
1547 : m_pSVData(ImplGetSVData())
1548 , m_pWindow(pWindow)
1549 , m_aMousePos(rMousePos)
1550 {
1551 }
1552 bool Setup();
1553 vcl::Window* FindTarget();
1554 vcl::Window* Dispatch(vcl::Window* pTarget);
1555 virtual bool CallCommand(vcl::Window *pWindow, const Point &rMousePos) = 0;
1556 virtual ~HandleGestureEventBase() {}
1557};
1558
1559}
1560
1561bool HandleGestureEventBase::Setup()
1562{
1563
1564 if (m_pSVData->mpWinData->mpAutoScrollWin)
1565 m_pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
1566 if (ImplGetSVHelpData().mpHelpWin)
1567 ImplDestroyHelpWindow( true );
1568 return !m_pWindow->isDisposed();
1569}
1570
1571vcl::Window* HandleGestureEventBase::FindTarget()
1572{
1573 // first check any floating window ( eg. drop down listboxes)
1574 vcl::Window *pMouseWindow = nullptr;
1575
1576 if (m_pSVData->mpWinData->mpFirstFloat && !m_pSVData->mpWinData->mpCaptureWin &&
1577 !m_pSVData->mpWinData->mpFirstFloat->ImplIsFloatPopupModeWindow( m_pWindow ) )
1578 {
1579 bool bHitTestInsideRect = false;
1580 pMouseWindow = m_pSVData->mpWinData->mpFirstFloat->ImplFloatHitTest( m_pWindow, m_aMousePos, bHitTestInsideRect );
1581 if (!pMouseWindow)
1582 pMouseWindow = m_pSVData->mpWinData->mpFirstFloat;
1583 }
1584 // then try the window directly beneath the mouse
1585 if( !pMouseWindow )
1586 {
1587 pMouseWindow = m_pWindow->ImplFindWindow( m_aMousePos );
1588 }
1589 else
1590 {
1591 // transform coordinates to float window frame coordinates
1592 pMouseWindow = pMouseWindow->ImplFindWindow(
1593 pMouseWindow->OutputToScreenPixel(
1594 pMouseWindow->AbsoluteScreenToOutputPixel(
1595 m_pWindow->OutputToAbsoluteScreenPixel(
1596 m_pWindow->ScreenToOutputPixel( m_aMousePos ) ) ) ) );
1597 }
1598
1599 while (acceptableWheelScrollTarget(pMouseWindow))
1600 {
1601 if (pMouseWindow->IsEnabled())
1602 break;
1603 //try the parent if this one is disabled
1604 pMouseWindow = pMouseWindow->GetParent();
1605 }
1606
1607 return pMouseWindow;
1608}
1609
1610vcl::Window *HandleGestureEventBase::Dispatch(vcl::Window* pMouseWindow)
1611{
1612 vcl::Window *pDispatchedTo = nullptr;
1613
1614 if (acceptableWheelScrollTarget(pMouseWindow) && pMouseWindow->IsEnabled())
1615 {
1616 // transform coordinates to float window frame coordinates
1617 Point aRelMousePos( pMouseWindow->OutputToScreenPixel(
1618 pMouseWindow->AbsoluteScreenToOutputPixel(
1619 m_pWindow->OutputToAbsoluteScreenPixel(
1620 m_pWindow->ScreenToOutputPixel( m_aMousePos ) ) ) ) );
1621 bool bPropagate = CallCommand(pMouseWindow, aRelMousePos);
1622 if (!bPropagate)
1623 pDispatchedTo = pMouseWindow;
1624 }
1625
1626 // if the command was not handled try the focus window
1627 if (!pDispatchedTo)
1628 {
1629 vcl::Window* pFocusWindow = m_pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
1630 if ( pFocusWindow && (pFocusWindow != pMouseWindow) &&
1631 (pFocusWindow == m_pSVData->mpWinData->mpFocusWin) )
1632 {
1633 // no wheel-messages to disabled windows
1634 if ( pFocusWindow->IsEnabled() && pFocusWindow->IsInputEnabled() && ! pFocusWindow->IsInModalMode() )
1635 {
1636 // transform coordinates to focus window frame coordinates
1637 Point aRelMousePos( pFocusWindow->OutputToScreenPixel(
1638 pFocusWindow->AbsoluteScreenToOutputPixel(
1639 m_pWindow->OutputToAbsoluteScreenPixel(
1640 m_pWindow->ScreenToOutputPixel( m_aMousePos ) ) ) ) );
1641 bool bPropagate = CallCommand(pFocusWindow, aRelMousePos);
1642 if (!bPropagate)
1643 pDispatchedTo = pMouseWindow;
1644 }
1645 }
1646 }
1647 return pDispatchedTo;
1648}
1649
1650namespace {
1651
1652class HandleWheelEvent : public HandleGestureEventBase
1653{
1654private:
1655 CommandWheelData m_aWheelData;
1656public:
1657 HandleWheelEvent(vcl::Window *pWindow, const SalWheelMouseEvent& rEvt)
1658 : HandleGestureEventBase(pWindow, Point(rEvt.mnX, rEvt.mnY))
1659 {
1660 CommandWheelMode nMode;
1661 sal_uInt16 nCode = rEvt.mnCode;
1662 bool bHorz = rEvt.mbHorz;
1663 bool bPixel = rEvt.mbDeltaIsPixel;
1664 if ( nCode & KEY_MOD1 )
1665 nMode = CommandWheelMode::ZOOM;
1666 else if ( nCode & KEY_MOD2 )
1668 else
1669 {
1671 // #i85450# interpret shift-wheel as horizontal wheel action
1672 if( (nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)) == KEY_SHIFT )
1673 bHorz = true;
1674 }
1675
1676 m_aWheelData = CommandWheelData(rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz, bPixel);
1677
1678 }
1679 virtual bool CallCommand(vcl::Window *pWindow, const Point &rMousePos) override
1680 {
1681 return ImplCallWheelCommand(pWindow, rMousePos, &m_aWheelData);
1682 }
1683 bool HandleEvent(const SalWheelMouseEvent& rEvt);
1684};
1685
1686}
1687
1688bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
1689{
1690 if (!Setup())
1691 return false;
1692
1693 VclPtr<vcl::Window> xMouseWindow = FindTarget();
1694
1695 ImplSVData* pSVData = ImplGetSVData();
1696
1697 // avoid the problem that scrolling via wheel to this point brings a widget
1698 // under the mouse that also accepts wheel commands, so stick with the old
1699 // widget if the time gap is very small
1702 {
1703 xMouseWindow = pSVData->mpWinData->mpLastWheelWindow;
1704 }
1705
1706 pSVData->mpWinData->maLastWheelEvent = rEvt;
1707
1708 pSVData->mpWinData->mpLastWheelWindow = Dispatch(xMouseWindow);
1709
1710 return pSVData->mpWinData->mpLastWheelWindow;
1711}
1712
1713namespace {
1714
1715class HandleGestureEvent : public HandleGestureEventBase
1716{
1717public:
1718 HandleGestureEvent(vcl::Window *pWindow, const Point &rMousePos)
1719 : HandleGestureEventBase(pWindow, rMousePos)
1720 {
1721 }
1722 bool HandleEvent();
1723};
1724
1725}
1726
1727bool HandleGestureEvent::HandleEvent()
1728{
1729 if (!Setup())
1730 return false;
1731
1732 vcl::Window *pTarget = FindTarget();
1733
1734 bool bHandled = Dispatch(pTarget) != nullptr;
1735 return bHandled;
1736}
1737
1738static bool ImplHandleWheelEvent(vcl::Window* pWindow, const SalWheelMouseEvent& rEvt)
1739{
1740 HandleWheelEvent aHandler(pWindow, rEvt);
1741 return aHandler.HandleEvent(rEvt);
1742}
1743
1744namespace {
1745
1746class HandleGestureSwipeEvent : public HandleGestureEvent
1747{
1748private:
1749 CommandGestureSwipeData m_aSwipeData;
1750public:
1751 HandleGestureSwipeEvent(vcl::Window *pWindow, const SalGestureSwipeEvent& rEvt)
1752 : HandleGestureEvent(pWindow, Point(rEvt.mnX, rEvt.mnY)),
1753 m_aSwipeData(rEvt.mnVelocityX)
1754 {
1755 }
1756 virtual bool CallCommand(vcl::Window *pWindow, const Point &/*rMousePos*/) override
1757 {
1758 return ImplCallCommand(pWindow, CommandEventId::GestureSwipe, &m_aSwipeData);
1759 }
1760};
1761
1762}
1763
1764static bool ImplHandleSwipe(vcl::Window *pWindow, const SalGestureSwipeEvent& rEvt)
1765{
1766 HandleGestureSwipeEvent aHandler(pWindow, rEvt);
1767 return aHandler.HandleEvent();
1768}
1769
1770namespace {
1771
1772class HandleGestureLongPressEvent : public HandleGestureEvent
1773{
1774private:
1775 CommandGestureLongPressData m_aLongPressData;
1776public:
1777 HandleGestureLongPressEvent(vcl::Window *pWindow, const SalGestureLongPressEvent& rEvt)
1778 : HandleGestureEvent(pWindow, Point(rEvt.mnX, rEvt.mnY)),
1779 m_aLongPressData(rEvt.mnX, rEvt.mnY)
1780 {
1781 }
1782 virtual bool CallCommand(vcl::Window *pWindow, const Point &/*rMousePos*/) override
1783 {
1784 return ImplCallCommand(pWindow, CommandEventId::GestureLongPress, &m_aLongPressData);
1785 }
1786};
1787
1788}
1789
1791{
1792 HandleGestureLongPressEvent aHandler(pWindow, rEvt);
1793 return aHandler.HandleEvent();
1794}
1795
1796namespace {
1797
1798class HandleGesturePanEvent : public HandleGestureEvent
1799{
1800private:
1801 CommandGesturePanData m_aGestureData;
1802
1803public:
1804 HandleGesturePanEvent(vcl::Window* pWindow, const SalGestureEvent& rEvent)
1805 : HandleGestureEvent(pWindow, Point(rEvent.mnX, rEvent.mnY))
1806 , m_aGestureData(rEvent.mnX, rEvent.mnY, rEvent.meEventType, rEvent.mfOffset, rEvent.meOrientation)
1807 {
1808 }
1809
1810 virtual bool CallCommand(vcl::Window* pWindow, const Point& /*rMousePos*/) override
1811 {
1812 return ImplCallCommand(pWindow, CommandEventId::GesturePan, &m_aGestureData);
1813 }
1814};
1815
1816}
1817
1818static bool ImplHandleGestureEvent(vcl::Window* pWindow, const SalGestureEvent& rEvent)
1819{
1820 HandleGesturePanEvent aHandler(pWindow, rEvent);
1821 return aHandler.HandleEvent();
1822}
1823
1824namespace {
1825
1826class HandleGestureZoomEvent : public HandleGestureEvent
1827{
1828private:
1829 CommandGestureZoomData m_aGestureData;
1830
1831public:
1832 HandleGestureZoomEvent(vcl::Window* pWindow, const SalGestureZoomEvent& rEvent)
1833 : HandleGestureEvent(pWindow, Point(rEvent.mnX, rEvent.mnY))
1834 , m_aGestureData(rEvent.mnX, rEvent.mnY, rEvent.meEventType, rEvent.mfScaleDelta)
1835 {
1836 }
1837
1838 virtual bool CallCommand(vcl::Window* pWindow, const Point& /*rMousePos*/) override
1839 {
1840 return ImplCallCommand(pWindow, CommandEventId::GestureZoom, &m_aGestureData);
1841 }
1842};
1843
1844}
1845
1847{
1848 HandleGestureZoomEvent aHandler(pWindow, rEvent);
1849 return aHandler.HandleEvent();
1850}
1851
1852namespace {
1853
1854class HandleGestureRotateEvent : public HandleGestureEvent
1855{
1856private:
1857 CommandGestureRotateData m_aGestureData;
1858
1859public:
1860 HandleGestureRotateEvent(vcl::Window* pWindow, const SalGestureRotateEvent& rEvent)
1861 : HandleGestureEvent(pWindow, Point(rEvent.mnX, rEvent.mnY))
1862 , m_aGestureData(rEvent.mnX, rEvent.mnY, rEvent.meEventType, rEvent.mfAngleDelta)
1863 {
1864 }
1865
1866 virtual bool CallCommand(vcl::Window* pWindow, const Point& /*rMousePos*/) override
1867 {
1868 return ImplCallCommand(pWindow, CommandEventId::GestureRotate, &m_aGestureData);
1869 }
1870};
1871
1872}
1873
1875{
1876 HandleGestureRotateEvent aHandler(pWindow, rEvent);
1877 return aHandler.HandleEvent();
1878}
1879
1880static void ImplHandlePaint( vcl::Window* pWindow, const tools::Rectangle& rBoundRect, bool bImmediateUpdate )
1881{
1882 // system paint events must be checked for re-mirroring
1884
1885 // trigger paint for all windows that live in the new paint region
1886 vcl::Region aRegion( rBoundRect );
1887 pWindow->ImplInvalidateOverlapFrameRegion( aRegion );
1888 if( bImmediateUpdate )
1889 {
1890 // #i87663# trigger possible pending resize notifications
1891 // (GetSizePixel does that for us)
1892 pWindow->GetSizePixel();
1893 // force drawing immediately
1894 pWindow->PaintImmediately();
1895 }
1896}
1897
1898static void KillOwnPopups( vcl::Window const * pWindow )
1899{
1900 ImplSVData* pSVData = ImplGetSVData();
1901 vcl::Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow;
1902 vcl::Window *pChild = pSVData->mpWinData->mpFirstFloat;
1903 if ( pChild && pParent->ImplIsWindowOrChild( pChild, true ) )
1904 {
1905 if (!(pSVData->mpWinData->mpFirstFloat->GetPopupModeFlags()
1909 }
1910}
1911
1912void ImplHandleResize( vcl::Window* pWindow, tools::Long nNewWidth, tools::Long nNewHeight )
1913{
1914 const bool bChanged = (nNewWidth != pWindow->GetOutputSizePixel().Width()) || (nNewHeight != pWindow->GetOutDev()->GetOutputHeightPixel());
1915 if (bChanged && pWindow->GetStyle() & (WB_MOVEABLE|WB_SIZEABLE))
1916 {
1917 KillOwnPopups( pWindow );
1918 if( pWindow->ImplGetWindow() != ImplGetSVHelpData().mpHelpWin )
1919 ImplDestroyHelpWindow( true );
1920 }
1921
1922 if (
1923 (nNewWidth > 0 && nNewHeight > 0) ||
1925 )
1926 {
1927 if (bChanged)
1928 {
1929 pWindow->GetOutDev()->mnOutWidth = nNewWidth;
1930 pWindow->GetOutDev()->mnOutHeight = nNewHeight;
1931 pWindow->ImplGetWindowImpl()->mbWaitSystemResize = false;
1932 if ( pWindow->IsReallyVisible() )
1933 pWindow->ImplSetClipFlag();
1934 if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize ||
1935 ( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplGetWindowImpl()->mpClientWindow ) ) // propagate resize for system border windows
1936 {
1937 bool bStartTimer = true;
1938 // use resize buffering for user resizes
1939 // ownerdraw decorated windows and floating windows can be resized immediately (i.e. synchronously)
1940 if( pWindow->ImplGetWindowImpl()->mbFrame && (pWindow->GetStyle() & WB_SIZEABLE)
1941 && !(pWindow->GetStyle() & WB_OWNERDRAWDECORATION) // synchronous resize for ownerdraw decorated windows (toolbars)
1942 && !pWindow->ImplGetWindowImpl()->mbFloatWin ) // synchronous resize for floating windows, #i43799#
1943 {
1944 if( pWindow->ImplGetWindowImpl()->mpClientWindow )
1945 {
1946 // #i42750# presentation wants to be informed about resize
1947 // as early as possible
1948 WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow->ImplGetWindowImpl()->mpClientWindow.get());
1949 if( ! pWorkWindow || pWorkWindow->IsPresentationMode() )
1950 bStartTimer = false;
1951 }
1952 else
1953 {
1954 WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow);
1955 if( ! pWorkWindow || pWorkWindow->IsPresentationMode() )
1956 bStartTimer = false;
1957 }
1958 }
1959 else
1960 bStartTimer = false;
1961
1962 if( bStartTimer )
1964 else
1965 pWindow->ImplCallResize(); // otherwise menus cannot be positioned
1966 }
1967 else
1968 pWindow->ImplGetWindowImpl()->mbCallResize = true;
1969
1970 if (pWindow->SupportsDoubleBuffering() && pWindow->ImplGetWindowImpl()->mbFrame)
1971 {
1972 // Propagate resize for the frame's buffer.
1974 }
1975 }
1976 }
1977
1979 (nNewHeight < IMPL_MIN_NEEDSYSWIN);
1980 bool bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
1981 if( bMinimized != pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized )
1982 pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
1983 pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized = bMinimized;
1984}
1985
1986static void ImplHandleMove( vcl::Window* pWindow )
1987{
1988 if( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplIsFloatingWindow() && pWindow->IsReallyVisible() )
1989 {
1990 static_cast<FloatingWindow*>(pWindow)->EndPopupMode( FloatWinPopupEndFlags::TearOff );
1991 pWindow->ImplCallMove();
1992 }
1993
1994 if( pWindow->GetStyle() & (WB_MOVEABLE|WB_SIZEABLE) )
1995 {
1996 KillOwnPopups( pWindow );
1997 if( pWindow->ImplGetWindow() != ImplGetSVHelpData().mpHelpWin )
1998 ImplDestroyHelpWindow( true );
1999 }
2000
2001 if ( pWindow->IsVisible() )
2002 pWindow->ImplCallMove();
2003 else
2004 pWindow->ImplGetWindowImpl()->mbCallMove = true; // make sure the framepos will be updated on the next Show()
2005
2006 if ( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplGetWindowImpl()->mpClientWindow )
2007 pWindow->ImplGetWindowImpl()->mpClientWindow->ImplCallMove(); // notify client to update geometry
2008
2009}
2010
2011static void ImplHandleMoveResize( vcl::Window* pWindow, tools::Long nNewWidth, tools::Long nNewHeight )
2012{
2013 ImplHandleMove( pWindow );
2014 ImplHandleResize( pWindow, nNewWidth, nNewHeight );
2015}
2016
2017static void ImplActivateFloatingWindows( vcl::Window const * pWindow, bool bActive )
2018{
2019 // First check all overlapping windows
2020 vcl::Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
2021 while ( pTempWindow )
2022 {
2023 if ( pTempWindow->GetActivateMode() == ActivateModeFlags::NONE )
2024 {
2025 if ( (pTempWindow->GetType() == WindowType::BORDERWINDOW) &&
2026 (pTempWindow->ImplGetWindow()->GetType() == WindowType::FLOATINGWINDOW) )
2027 static_cast<ImplBorderWindow*>(pTempWindow)->SetDisplayActive( bActive );
2028 }
2029
2030 ImplActivateFloatingWindows( pTempWindow, bActive );
2031 pTempWindow = pTempWindow->ImplGetWindowImpl()->mpNext;
2032 }
2033}
2034
2035IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
2036{
2037 if (!ImplGetWindowImpl() || !ImplGetWindowImpl()->mpFrameData)
2038 return;
2039
2040 ImplGetWindowImpl()->mpFrameData->mnFocusId = nullptr;
2041
2042 // If the status has been preserved, because we got back the focus
2043 // in the meantime, we do nothing
2044 bool bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
2045
2046 // next execute the delayed functions
2047 if ( bHasFocus )
2048 {
2049 // redraw all floating windows inactive
2050 if ( ImplGetWindowImpl()->mpFrameData->mbStartFocusState != bHasFocus )
2051 ImplActivateFloatingWindows( this, bHasFocus );
2052
2053 if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin )
2054 {
2055 bool bHandled = false;
2056 if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInputEnabled() &&
2057 ! ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInModalMode() )
2058 {
2059 if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsEnabled() )
2060 {
2061 ImplGetWindowImpl()->mpFrameData->mpFocusWin->GrabFocus();
2062 bHandled = true;
2063 }
2064 else if( ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplHasDlgCtrl() )
2065 {
2066 // #109094# if the focus is restored to a disabled dialog control (was disabled meanwhile)
2067 // try to move it to the next control
2068 ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplDlgCtrlNextWindow();
2069 bHandled = true;
2070 }
2071 }
2072 if ( !bHandled )
2073 {
2074 ImplSVData* pSVData = ImplGetSVData();
2075 vcl::Window* pTopLevelWindow = ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplGetFirstOverlapWindow();
2076
2077 if ((!pTopLevelWindow->IsInputEnabled() || pTopLevelWindow->IsInModalMode())
2078 && !pSVData->mpWinData->mpExecuteDialogs.empty())
2080 else
2081 pTopLevelWindow->GrabFocus();
2082 }
2083 }
2084 else
2085 GrabFocus();
2086 }
2087 else
2088 {
2089 vcl::Window* pFocusWin = ImplGetWindowImpl()->mpFrameData->mpFocusWin;
2090 if ( pFocusWin )
2091 {
2092 ImplSVData* pSVData = ImplGetSVData();
2093
2094 if (pSVData->mpWinData->mpFocusWin == pFocusWin)
2095 {
2096 // transfer the FocusWindow
2097 vcl::Window* pOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
2098 if ( pOverlapWindow && pOverlapWindow->ImplGetWindowImpl() )
2099 pOverlapWindow->ImplGetWindowImpl()->mpLastFocusWindow = pFocusWin;
2100 pSVData->mpWinData->mpFocusWin = nullptr;
2101
2102 if ( pFocusWin->ImplGetWindowImpl() && pFocusWin->ImplGetWindowImpl()->mpCursor )
2103 pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
2104
2105 // call the Deactivate
2106 vcl::Window* pOldOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
2107 vcl::Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
2108
2109 if (pOldOverlapWindow && pOldOverlapWindow->ImplGetWindowImpl() &&
2110 pOldRealWindow && pOldRealWindow->ImplGetWindowImpl())
2111 {
2112 pOldOverlapWindow->ImplGetWindowImpl()->mbActive = false;
2113 pOldOverlapWindow->Deactivate();
2114 if ( pOldRealWindow != pOldOverlapWindow )
2115 {
2116 pOldRealWindow->ImplGetWindowImpl()->mbActive = false;
2117 pOldRealWindow->Deactivate();
2118 }
2119 }
2120
2121 // TrackingMode is ended in ImplHandleLoseFocus
2122#ifdef _WIN32
2123 // To avoid problems with the Unix IME
2124 pFocusWin->EndExtTextInput();
2125#endif
2126
2127 NotifyEvent aNEvt(NotifyEventType::LOSEFOCUS, pFocusWin);
2128 if (!ImplCallPreNotify(aNEvt))
2129 pFocusWin->CompatLoseFocus();
2130 pFocusWin->ImplCallDeactivateListeners(nullptr);
2131 }
2132 }
2133
2134 // Redraw all floating window inactive
2135 if ( ImplGetWindowImpl()->mpFrameData->mbStartFocusState != bHasFocus )
2136 ImplActivateFloatingWindows( this, bHasFocus );
2137 }
2138}
2139
2140static void ImplHandleGetFocus( vcl::Window* pWindow )
2141{
2142 if (!pWindow || !pWindow->ImplGetWindowImpl() || !pWindow->ImplGetWindowImpl()->mpFrameData)
2143 return;
2144
2145 pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = true;
2146
2147 // execute Focus-Events after a delay, such that SystemChildWindows
2148 // do not blink when they receive focus
2149 if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
2150 {
2152 pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true);
2153 vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
2154 if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
2155 pFocusWin->ImplGetWindowImpl()->mpCursor->ImplShow();
2156 }
2157}
2158
2159static void ImplHandleLoseFocus( vcl::Window* pWindow )
2160{
2161 if (!pWindow)
2162 return;
2163
2164 ImplSVData* pSVData = ImplGetSVData();
2165
2166 // Abort the autoscroll if the frame loses focus
2167 if (pSVData->mpWinData->mpAutoScrollWin)
2169
2170 // Abort tracking if the frame loses focus
2171 if (pSVData->mpWinData->mpTrackWin)
2172 {
2173 if (pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl() &&
2174 pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl()->mpFrameWindow == pWindow)
2176 }
2177
2178 if (pWindow->ImplGetWindowImpl() && pWindow->ImplGetWindowImpl()->mpFrameData)
2179 {
2180 pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = false;
2181
2182 // execute Focus-Events after a delay, such that SystemChildWindows
2183 // do not flicker when they receive focus
2184 if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
2185 {
2187 pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true );
2188 }
2189
2190 vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
2191 if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
2192 pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
2193 }
2194
2195 // Make sure that no menu is visible when a toplevel window loses focus.
2196 VclPtr<FloatingWindow> pFirstFloat = pSVData->mpWinData->mpFirstFloat;
2197 if (pFirstFloat && pFirstFloat->IsMenuFloatingWindow() && !pWindow->GetParent())
2198 {
2200 }
2201}
2202
2203namespace {
2204
2205struct DelayedCloseEvent
2206{
2207 VclPtr<vcl::Window> pWindow;
2208};
2209
2210}
2211
2212static void DelayedCloseEventLink( void* pCEvent, void* )
2213{
2214 DelayedCloseEvent* pEv = static_cast<DelayedCloseEvent*>(pCEvent);
2215
2216 if( ! pEv->pWindow->isDisposed() )
2217 {
2218 // dispatch to correct window type
2219 if( pEv->pWindow->IsSystemWindow() )
2220 static_cast<SystemWindow*>(pEv->pWindow.get())->Close();
2221 else if( pEv->pWindow->IsDockingWindow() )
2222 static_cast<DockingWindow*>(pEv->pWindow.get())->Close();
2223 }
2224 delete pEv;
2225}
2226
2227static void ImplHandleClose( const vcl::Window* pWindow )
2228{
2229 ImplSVData* pSVData = ImplGetSVData();
2230
2231 bool bWasPopup = false;
2232 if( pWindow->ImplIsFloatingWindow() &&
2233 static_cast<const FloatingWindow*>(pWindow)->ImplIsInPrivatePopupMode() )
2234 {
2235 bWasPopup = true;
2236 }
2237
2238 // on Close stop all floating modes and end popups
2239 if (pSVData->mpWinData->mpFirstFloat)
2240 {
2241 FloatingWindow* pLastLevelFloat;
2242 pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
2244 }
2245 if ( ImplGetSVHelpData().mbExtHelpMode )
2247 if ( ImplGetSVHelpData().mpHelpWin )
2248 ImplDestroyHelpWindow( false );
2249 // AutoScrollMode
2250 if (pSVData->mpWinData->mpAutoScrollWin)
2252
2253 if (pSVData->mpWinData->mpTrackWin)
2255
2256 if (bWasPopup)
2257 return;
2258
2259 vcl::Window *pWin = pWindow->ImplGetWindow();
2260 SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(pWin);
2261 if (pSysWin)
2262 {
2263 // See if the custom close handler is set.
2264 const Link<SystemWindow&,void>& rLink = pSysWin->GetCloseHdl();
2265 if (rLink.IsSet())
2266 {
2267 rLink.Call(*pSysWin);
2268 return;
2269 }
2270 }
2271
2272 // check whether close is allowed
2273 if ( pWin->IsEnabled() && pWin->IsInputEnabled() && !pWin->IsInModalMode() )
2274 {
2275 DelayedCloseEvent* pEv = new DelayedCloseEvent;
2276 pEv->pWindow = pWin;
2278 }
2279}
2280
2281static void ImplHandleUserEvent( ImplSVEvent* pSVEvent )
2282{
2283 if ( pSVEvent )
2284 {
2285 if ( pSVEvent->mbCall )
2286 {
2287 pSVEvent->maLink.Call( pSVEvent->mpData );
2288 }
2289
2290 delete pSVEvent;
2291 }
2292}
2293
2295{
2297 if ( !pEvent->mnCode )
2299 if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) )
2301 if ( (pEvent->mnCode & MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) )
2303 return nMode;
2304}
2305
2307{
2309 if ( pEvent->mnButton == MOUSE_LEFT )
2311 if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) )
2313 if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) &&
2314 !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_SHIFT)) )
2316 if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_SHIFT) &&
2317 !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_MOD1)) )
2319 return nMode;
2320}
2321
2322static bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * pEvent )
2323{
2324 return ImplHandleMouseEvent( pWindow, NotifyEventType::MOUSEMOVE, true,
2325 pEvent->mnX, pEvent->mnY,
2326 pEvent->mnTime, pEvent->mnCode,
2327 ImplGetMouseMoveMode( pEvent ) );
2328}
2329
2330static bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * pEvent )
2331{
2332 return ImplHandleMouseEvent( pWindow, NotifyEventType::MOUSEMOVE, false,
2333 pEvent->mnX, pEvent->mnY,
2334 pEvent->mnTime, pEvent->mnCode,
2335 ImplGetMouseMoveMode( pEvent ) );
2336}
2337
2338static bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent const * pEvent )
2339{
2341 pEvent->mnX, pEvent->mnY,
2342 pEvent->mnTime,
2343#ifdef MACOSX
2344 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)),
2345#else
2346 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)),
2347#endif
2348 ImplGetMouseButtonMode( pEvent ) );
2349}
2350
2351static bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent const * pEvent )
2352{
2354 pEvent->mnX, pEvent->mnY,
2355 pEvent->mnTime,
2356#ifdef MACOSX
2357 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)),
2358#else
2359 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)),
2360#endif
2361 ImplGetMouseButtonMode( pEvent ) );
2362}
2363
2364static bool ImplHandleMenuEvent( vcl::Window const * pWindow, SalMenuEvent* pEvent, SalEvent nEvent )
2365{
2366 // Find SystemWindow and its Menubar and let it dispatch the command
2367 bool bRet = false;
2368 vcl::Window *pWin = pWindow->ImplGetWindowImpl()->mpFirstChild;
2369 while ( pWin )
2370 {
2371 if ( pWin->ImplGetWindowImpl()->mbSysWin )
2372 break;
2373 pWin = pWin->ImplGetWindowImpl()->mpNext;
2374 }
2375 if( pWin )
2376 {
2377 MenuBar *pMenuBar = static_cast<SystemWindow*>(pWin)->GetMenuBar();
2378 if( pMenuBar )
2379 {
2380 switch( nEvent )
2381 {
2383 pMenuBar->HandleMenuActivateEvent( static_cast<Menu*>(pEvent->mpMenu) );
2384 bRet = true;
2385 break;
2387 pMenuBar->HandleMenuDeActivateEvent( static_cast<Menu*>(pEvent->mpMenu) );
2388 bRet = true;
2389 break;
2391 bRet = pMenuBar->HandleMenuHighlightEvent( static_cast<Menu*>(pEvent->mpMenu), pEvent->mnId );
2392 break;
2394 bRet = pMenuBar->HandleMenuButtonEvent( pEvent->mnId );
2395 break;
2397 bRet = pMenuBar->HandleMenuCommandEvent( static_cast<Menu*>(pEvent->mpMenu), pEvent->mnId );
2398 break;
2399 default:
2400 break;
2401 }
2402 }
2403 }
2404 return bRet;
2405}
2406
2407static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent const * pEvent )
2408{
2409 ImplSVData* pSVData = ImplGetSVData();
2410 vcl::Window* pTrackWin = pSVData->mpWinData->mpTrackWin;
2411 if ( pTrackWin )
2412 pWindow = pTrackWin;
2413#ifdef MACOSX
2414 sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
2415#else
2416 sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
2417#endif
2418 sal_uInt16 nNewCode = pEvent->mnCode;
2419 if ( nOldCode != nNewCode )
2420 {
2421#ifdef MACOSX
2422 nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
2423#else
2424 nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
2425#endif
2426 pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, true );
2427 }
2428
2429 // #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
2430 // + auto-accelerator feature, tdf#92630
2431
2432 // try to find a key input window...
2433 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2434 //...otherwise fail safe...
2435 if (!pChild)
2436 pChild = pWindow;
2437
2438 CommandModKeyData data( pEvent->mnModKeyCode, pEvent->mbDown );
2440}
2441
2443{
2444 // find window
2445 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2446 if ( !pChild )
2447 return;
2448
2450}
2451
2452static void ImplHandleSalSettings( SalEvent nEvent )
2453{
2454 Application* pApp = GetpApp();
2455 if ( !pApp )
2456 return;
2457
2458 if ( nEvent == SalEvent::SettingsChanged )
2459 {
2462 pApp->OverrideSystemSettings( aSettings );
2463 Application::SetSettings( aSettings );
2464 }
2465 else
2466 {
2468 switch ( nEvent )
2469 {
2473 break;
2476 break;
2480 break;
2481 default:
2483 break;
2484 }
2485
2487 {
2488 DataChangedEvent aDCEvt( nType );
2491 }
2492 }
2493}
2494
2496{
2497 tools::Rectangle aCursorRect;
2498 ImplHandleExtTextInputPos( pWindow, aCursorRect, pEvt->mnExtWidth, &pEvt->mbVertical );
2499 if ( aCursorRect.IsEmpty() )
2500 {
2501 pEvt->mnX = -1;
2502 pEvt->mnY = -1;
2503 pEvt->mnWidth = -1;
2504 pEvt->mnHeight = -1;
2505 }
2506 else
2507 {
2508 pEvt->mnX = aCursorRect.Left();
2509 pEvt->mnY = aCursorRect.Top();
2510 pEvt->mnWidth = aCursorRect.GetWidth();
2511 pEvt->mnHeight = aCursorRect.GetHeight();
2512 }
2513}
2514
2515static bool ImplHandleShowDialog( vcl::Window* pWindow, ShowDialogId nDialogId )
2516{
2517 if( ! pWindow )
2518 return false;
2519
2520 if( pWindow->GetType() == WindowType::BORDERWINDOW )
2521 {
2522 vcl::Window* pWrkWin = pWindow->GetWindow( GetWindowType::Client );
2523 if( pWrkWin )
2524 pWindow = pWrkWin;
2525 }
2526 CommandDialogData aCmdData( nDialogId );
2527 return ImplCallCommand( pWindow, CommandEventId::ShowDialog, &aCmdData );
2528}
2529
2531 OUString& rText,
2532 Selection &rSelRange )
2533{
2534 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2535
2536 if ( !pChild )
2537 {
2538 rText.clear();
2539 rSelRange.setMin( 0 );
2540 rSelRange.setMax( 0 );
2541 }
2542 else
2543 {
2544 rText = pChild->GetSurroundingText();
2545 Selection aSel = pChild->GetSurroundingTextSelection();
2546 rSelRange.setMin( aSel.Min() );
2547 rSelRange.setMax( aSel.Max() );
2548 }
2549}
2550
2553{
2554 Selection aSelRange;
2555 ImplHandleSurroundingTextRequest( pWindow, pEvt->maText, aSelRange );
2556
2557 aSelRange.Normalize();
2558
2559 if( aSelRange.Min() < 0 )
2560 pEvt->mnStart = 0;
2561 else if( aSelRange.Min() > pEvt->maText.getLength() )
2562 pEvt->mnStart = pEvt->maText.getLength();
2563 else
2564 pEvt->mnStart = aSelRange.Min();
2565
2566 if( aSelRange.Max() < 0 )
2567 pEvt->mnStart = 0;
2568 else if( aSelRange.Max() > pEvt->maText.getLength() )
2569 pEvt->mnEnd = pEvt->maText.getLength();
2570 else
2571 pEvt->mnEnd = aSelRange.Max();
2572}
2573
2576{
2577 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2578
2579 Selection aSelection(pEvt->mnStart, pEvt->mnEnd);
2580 if (pChild && pChild->DeleteSurroundingText(aSelection))
2581 {
2582 pEvt->mnStart = aSelection.Min();
2583 pEvt->mnEnd = aSelection.Max();
2584 }
2585 else
2586 {
2587 pEvt->mnStart = pEvt->mnEnd = SAL_MAX_UINT32;
2588 }
2589}
2590
2592 sal_uLong nStart,
2593 sal_uLong nEnd )
2594{
2595 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2596 if( pChild )
2597 {
2598 CommandSelectionChangeData data( nStart, nEnd );
2600 }
2601}
2602
2604{
2605 vcl::Window* pChild = ImplGetKeyInputWindow( pWindow );
2606 if( pChild )
2608}
2609
2612{
2613 pEvt->mbValid = false;
2614 pEvt->mbVertical = false;
2615 pEvt->mnCursorBoundX = 0;
2616 pEvt->mnCursorBoundY = 0;
2617 pEvt->mnCursorBoundWidth = 0;
2618 pEvt->mnCursorBoundHeight = 0;
2619
2620 ImplSVData* pSVData = ImplGetSVData();
2621 vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
2622
2623 if ( !pChild )
2624 pChild = ImplGetKeyInputWindow( pWindow );
2625 else
2626 {
2627 // Test, if the Window is related to the frame
2628 if ( !pWindow->ImplIsWindowOrChild( pChild ) )
2629 pChild = ImplGetKeyInputWindow( pWindow );
2630 }
2631
2632 if( !pChild )
2633 return;
2634
2636
2637 ImplWinData* pWinData = pChild->ImplGetWinData();
2638 if ( !(pWinData->mpCompositionCharRects && pEvt->mnCharPos < o3tl::make_unsigned( pWinData->mnCompositionCharRects )) )
2639 return;
2640
2641 const OutputDevice *pChildOutDev = pChild->GetOutDev();
2642 const tools::Rectangle& aRect = pWinData->mpCompositionCharRects[ pEvt->mnCharPos ];
2643 tools::Rectangle aDeviceRect = pChildOutDev->ImplLogicToDevicePixel( aRect );
2644 Point aAbsScreenPos = pChild->OutputToAbsoluteScreenPixel( pChild->ScreenToOutputPixel(aDeviceRect.TopLeft()) );
2645 pEvt->mnCursorBoundX = aAbsScreenPos.X();
2646 pEvt->mnCursorBoundY = aAbsScreenPos.Y();
2647 pEvt->mnCursorBoundWidth = aDeviceRect.GetWidth();
2648 pEvt->mnCursorBoundHeight = aDeviceRect.GetHeight();
2649 pEvt->mbVertical = pWinData->mbVertical;
2650 pEvt->mbValid = true;
2651}
2652
2653bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pEvent )
2654{
2656
2657 // Ensure the window survives during this method.
2658 VclPtr<vcl::Window> pWindow( _pWindow );
2659
2660 bool bRet = false;
2661
2662 // #119709# for some unknown reason it is possible to receive events (in this case key events)
2663 // although the corresponding VCL window must have been destroyed already
2664 // at least ImplGetWindowImpl() was NULL in these cases, so check this here
2665 if( pWindow->ImplGetWindowImpl() == nullptr )
2666 return false;
2667
2668 switch ( nEvent )
2669 {
2671 bRet = ImplHandleSalMouseMove( pWindow, static_cast<SalMouseEvent const *>(pEvent) );
2672 break;
2674 {
2675 MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
2676 SalMouseEvent aSalMouseEvent;
2677
2678 aSalMouseEvent.mnTime = tools::Time::GetSystemTicks();
2679 aSalMouseEvent.mnX = pMouseEvt->GetPosPixel().X();
2680 aSalMouseEvent.mnY = pMouseEvt->GetPosPixel().Y();
2681 aSalMouseEvent.mnButton = 0;
2682 aSalMouseEvent.mnCode = pMouseEvt->GetButtons() | pMouseEvt->GetModifier();
2683
2684 bRet = ImplHandleSalMouseMove( pWindow, &aSalMouseEvent );
2685 }
2686 break;
2688 bRet = ImplHandleSalMouseLeave( pWindow, static_cast<SalMouseEvent const *>(pEvent) );
2689 break;
2691 bRet = ImplHandleSalMouseButtonDown( pWindow, static_cast<SalMouseEvent const *>(pEvent) );
2692 break;
2694 {
2695 MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
2696 SalMouseEvent aSalMouseEvent;
2697
2698 aSalMouseEvent.mnTime = tools::Time::GetSystemTicks();
2699 aSalMouseEvent.mnX = pMouseEvt->GetPosPixel().X();
2700 aSalMouseEvent.mnY = pMouseEvt->GetPosPixel().Y();
2701 aSalMouseEvent.mnButton = pMouseEvt->GetButtons();
2702 aSalMouseEvent.mnCode = pMouseEvt->GetButtons() | pMouseEvt->GetModifier();
2703
2704 bRet = ImplHandleSalMouseButtonDown( pWindow, &aSalMouseEvent );
2705 }
2706 break;
2708 bRet = ImplHandleSalMouseButtonUp( pWindow, static_cast<SalMouseEvent const *>(pEvent) );
2709 break;
2711 {
2712 MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
2713 SalMouseEvent aSalMouseEvent;
2714
2715 aSalMouseEvent.mnTime = tools::Time::GetSystemTicks();
2716 aSalMouseEvent.mnX = pMouseEvt->GetPosPixel().X();
2717 aSalMouseEvent.mnY = pMouseEvt->GetPosPixel().Y();
2718 aSalMouseEvent.mnButton = pMouseEvt->GetButtons();
2719 aSalMouseEvent.mnCode = pMouseEvt->GetButtons() | pMouseEvt->GetModifier();
2720
2721 bRet = ImplHandleSalMouseButtonUp( pWindow, &aSalMouseEvent );
2722 }
2723 break;
2725 bRet = false;
2726 break;
2727 case SalEvent::KeyInput:
2728 {
2729 SalKeyEvent const * pKeyEvt = static_cast<SalKeyEvent const *>(pEvent);
2731 pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, true );
2732 }
2733 break;
2735 {
2736 KeyEvent const * pKeyEvt = static_cast<KeyEvent const *>(pEvent);
2738 pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), false );
2739 }
2740 break;
2741 case SalEvent::KeyUp:
2742 {
2743 SalKeyEvent const * pKeyEvt = static_cast<SalKeyEvent const *>(pEvent);
2744 bRet = ImplHandleKey( pWindow, NotifyEventType::KEYUP,
2745 pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, true );
2746 }
2747 break;
2749 {
2750 KeyEvent const * pKeyEvt = static_cast<KeyEvent const *>(pEvent);
2751 bRet = ImplHandleKey( pWindow, NotifyEventType::KEYUP,
2752 pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), false );
2753 }
2754 break;
2756 ImplHandleSalKeyMod( pWindow, static_cast<SalKeyModEvent const *>(pEvent) );
2757 break;
2758
2761 break;
2762
2768 bRet = ImplHandleMenuEvent( pWindow, const_cast<SalMenuEvent *>(static_cast<SalMenuEvent const *>(pEvent)), nEvent );
2769 break;
2770
2772 bRet = ImplHandleWheelEvent( pWindow, *static_cast<const SalWheelMouseEvent*>(pEvent));
2773 break;
2774
2775 case SalEvent::Paint:
2776 {
2777 SalPaintEvent const * pPaintEvt = static_cast<SalPaintEvent const *>(pEvent);
2778
2780 {
2781 SalFrame* pSalFrame = pWindow->ImplGetWindowImpl()->mpFrame;
2782 const_cast<SalPaintEvent *>(pPaintEvt)->mnBoundX = pSalFrame->maGeometry.width() - pPaintEvt->mnBoundWidth - pPaintEvt->mnBoundX;
2783 }
2784
2785 tools::Rectangle aBoundRect( Point( pPaintEvt->mnBoundX, pPaintEvt->mnBoundY ),
2786 Size( pPaintEvt->mnBoundWidth, pPaintEvt->mnBoundHeight ) );
2787 ImplHandlePaint( pWindow, aBoundRect, pPaintEvt->mbImmediateUpdate );
2788 }
2789 break;
2790
2791 case SalEvent::Move:
2792 ImplHandleMove( pWindow );
2793 break;
2794
2795 case SalEvent::Resize:
2796 {
2797 tools::Long nNewWidth;
2798 tools::Long nNewHeight;
2799 pWindow->ImplGetWindowImpl()->mpFrame->GetClientSize( nNewWidth, nNewHeight );
2800 ImplHandleResize( pWindow, nNewWidth, nNewHeight );
2801 }
2802 break;
2803
2805 {
2807 ImplHandleMoveResize(pWindow, g.width(), g.height());
2808 }
2809 break;
2810
2812 {
2813 KillOwnPopups( pWindow );
2814 }
2815 break;
2816
2817 case SalEvent::GetFocus:
2818 ImplHandleGetFocus( pWindow );
2819 break;
2821 ImplHandleLoseFocus( pWindow );
2822 break;
2823
2824 case SalEvent::Close:
2825 ImplHandleClose( pWindow );
2826 break;
2827
2828 case SalEvent::Shutdown:
2829 {
2830 static bool bInQueryExit = false;
2831 if( !bInQueryExit )
2832 {
2833 bInQueryExit = true;
2834 if ( GetpApp()->QueryExit() )
2835 {
2836 // end the message loop
2838 return false;
2839 }
2840 else
2841 {
2842 bInQueryExit = false;
2843 return true;
2844 }
2845 }
2846 return false;
2847 }
2848
2853 ImplHandleSalSettings( nEvent );
2854 break;
2855
2857 ImplHandleUserEvent( const_cast<ImplSVEvent *>(static_cast<ImplSVEvent const *>(pEvent)) );
2858 break;
2859
2861 {
2862 SalExtTextInputEvent const * pEvt = static_cast<SalExtTextInputEvent const *>(pEvent);
2863 bRet = ImplHandleExtTextInput( pWindow,
2864 pEvt->maText, pEvt->mpTextAttr,
2865 pEvt->mnCursorPos, pEvt->mnCursorFlags );
2866 }
2867 break;
2870 break;
2872 ImplHandleSalExtTextInputPos( pWindow, const_cast<SalExtTextInputPosEvent *>(static_cast<SalExtTextInputPosEvent const *>(pEvent)) );
2873 break;
2875 bRet = ImplHandleInputContextChange( pWindow );
2876 break;
2878 {
2879 ShowDialogId nLOKWindowId = static_cast<ShowDialogId>(reinterpret_cast<sal_IntPtr>(pEvent));
2880 bRet = ImplHandleShowDialog( pWindow, nLOKWindowId );
2881 }
2882 break;
2884 ImplHandleSalSurroundingTextRequest( pWindow, const_cast<SalSurroundingTextRequestEvent *>(static_cast<SalSurroundingTextRequestEvent const *>(pEvent)) );
2885 break;
2888 break;
2890 {
2892 = static_cast<SalSurroundingTextSelectionChangeEvent const *>(pEvent);
2894 pEvt->mnStart,
2895 pEvt->mnEnd );
2896 [[fallthrough]]; // TODO: Fallthrough really intended?
2897 }
2899 ImplHandleStartReconversion( pWindow );
2900 break;
2901
2903 ImplHandleSalQueryCharPosition( pWindow, const_cast<SalQueryCharPositionEvent *>(static_cast<SalQueryCharPositionEvent const *>(pEvent)) );
2904 break;
2905
2907 bRet = ImplHandleSwipe(pWindow, *static_cast<const SalGestureSwipeEvent*>(pEvent));
2908 break;
2909
2911 bRet = ImplHandleLongPress(pWindow, *static_cast<const SalGestureLongPressEvent*>(pEvent));
2912 break;
2913
2915 {
2916 auto const * pGestureEvent = static_cast<GestureEventPan const *>(pEvent);
2917
2918 SalGestureEvent aSalGestureEvent;
2919 aSalGestureEvent.mfOffset = pGestureEvent->mnOffset;
2920 aSalGestureEvent.mnX = pGestureEvent->mnX;
2921 aSalGestureEvent.mnY = pGestureEvent->mnY;
2922 aSalGestureEvent.meEventType = pGestureEvent->meEventType;
2923 aSalGestureEvent.meOrientation = pGestureEvent->meOrientation;
2924
2925 bRet = ImplHandleGestureEvent(pWindow, aSalGestureEvent);
2926 }
2927 break;
2929 {
2930 auto const * aSalGestureEvent = static_cast<SalGestureEvent const *>(pEvent);
2931 bRet = ImplHandleGestureEvent(pWindow, *aSalGestureEvent);
2932 }
2933 break;
2935 {
2936 const auto * pGestureEvent = static_cast<SalGestureZoomEvent const *>(pEvent);
2937 bRet = ImplHandleGestureZoomEvent(pWindow, *pGestureEvent);
2938 }
2939 break;
2941 {
2942 const auto * pGestureEvent = static_cast<SalGestureRotateEvent const *>(pEvent);
2943 bRet = ImplHandleGestureRotateEvent(pWindow, *pGestureEvent);
2944 }
2945 break;
2946 default:
2947 SAL_WARN( "vcl.layout", "ImplWindowFrameProc(): unknown event (" << static_cast<int>(nEvent) << ")" );
2948 break;
2949 }
2950
2951 return bRet;
2952}
2953
2954/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
const MouseSettings & GetMouseSettings() const
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
const LocaleDataWrapper & GetLocaleDataWrapper() const
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:237
virtual void OverrideSystemSettings(AllSettings &rSettings)
Sets user settings in settings object to override system settings.
Definition: svapp.cxx:521
static bool HandleKey(VclEventId nEvent, vcl::Window *pWin, KeyEvent *pKeyEvent)
Handle keypress event.
Definition: svapp.cxx:723
static void Yield()
Process the next event.
Definition: svapp.cxx:428
static void MergeSystemSettings(AllSettings &rSettings)
Set the settings object to the platform/desktop environment system settings.
Definition: svapp.cxx:525
static void ImplCallEventListenersApplicationDataChanged(void *pData)
Send event to all VCL application event listeners.
Definition: svapp.cxx:684
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:638
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
Definition: svapp.cxx:999
static void Quit()
Quit the program.
Definition: svapp.cxx:445
static void SetSettings(const AllSettings &rSettings)
Sets the application's settings and notifies all windows of the change.
Definition: svapp.cxx:544
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
Notify all windows that the application has changed data.
Definition: svapp.cxx:665
Definition: edit.hxx:56
SAL_DLLPRIVATE FloatingWindow * ImplFindLastLevelFloat()
Definition: floatwin.cxx:589
SAL_DLLPRIVATE bool ImplIsFloatPopupModeWindow(const vcl::Window *pWindow)
Definition: floatwin.cxx:606
SAL_DLLPRIVATE FloatingWindow * ImplFloatHitTest(vcl::Window *pReference, const Point &rPos, bool &rbHitTestInsideRect)
Definition: floatwin.cxx:548
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
Definition: floatwin.cxx:964
SAL_DLLPRIVATE void ImplSetMouseDown()
Definition: floatwin.hxx:94
bool GrabsFocus() const
Definition: floatwin.hxx:137
FloatWinPopupFlags GetPopupModeFlags() const
Definition: floatwin.hxx:128
SAL_DLLPRIVATE bool ImplIsMouseDown() const
Definition: floatwin.hxx:95
SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const
Definition: floatwin.hxx:104
void SetKeyboardActivated(bool bKeyboard)
Definition: event.hxx:210
static bool StartExtHelp()
Definition: help.cxx:107
static bool EndExtHelp()
Definition: help.cxx:125
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
bool IsAccelKey(const vcl::KeyCode &rKeyCode)
Definition: accmgr.cxx:90
const vcl::Font & GetFont() const
Definition: inputctx.hxx:56
sal_Unicode GetCharCode() const
Definition: event.hxx:56
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
sal_uInt16 GetRepeat() const
Definition: event.hxx:58
const OUString & getNumDecimalSep() const
bool HandleMenuButtonEvent(sal_uInt16 nEventId)
Definition: menu.cxx:2663
bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const
Definition: menu.cxx:2594
Definition: menu.hxx:116
bool HandleMenuActivateEvent(Menu *pMenu) const
Definition: menu.cxx:2563
bool HandleMenuDeActivateEvent(Menu *pMenu) const
Definition: menu.cxx:2579
bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const
Definition: menu.cxx:2619
sal_uInt16 GetModifier() const
Definition: event.hxx:156
sal_uInt16 GetButtons() const
Definition: event.hxx:147
const Point & GetPosPixel() const
Definition: event.hxx:123
MouseMiddleButtonAction GetMiddleButtonAction() const
sal_uInt64 GetDoubleClickTime() const
static sal_uInt16 GetStartDragCode()
sal_Int32 GetDoubleClickWidth() const
sal_Int32 GetDoubleClickHeight() const
sal_Int32 GetStartDragWidth() const
sal_Int32 GetStartDragHeight() const
static sal_uInt16 GetContextMenuClicks()
static sal_uInt16 GetContextMenuCode()
vcl::Window * GetWindow() const
Definition: event.hxx:309
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
Size GetOutputSize() const
Definition: outdev.hxx:327
static SAL_DLLPRIVATE void ImplUpdateAllFontData(bool bNewFontLists)
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:655
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
Definition: map.cxx:334
tools::Long GetOutputHeightPixel() const
Definition: outdev.hxx:317
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
Definition: map.cxx:280
tools::Long mnOutWidth
Definition: outdev.hxx:210
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:671
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:703
tools::Long mnOutHeight
Definition: outdev.hxx:211
constexpr tools::Long Y() const
constexpr tools::Long X() const
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
SalFrameGeometry maGeometry
absolute, unmirrored values
Definition: salframe.hxx:127
virtual void GetClientSize(tools::Long &rWidth, tools::Long &rHeight)=0
virtual void SetPointer(PointerStyle ePointerStyle)=0
SalFrameGeometry GetGeometry() const
tools::Long Min() const
void setMin(tools::Long nMin)
void setMax(tools::Long nMax)
void Normalize()
tools::Long Max() const
constexpr tools::Long getHeight() const
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
Definition: svapp.hxx:1414
sal_Int32 GetCursorSize() const
const Link< SystemWindow &, void > & GetCloseHdl() const
Definition: syswin.cxx:976
static UITestLogger & getInstance()
Definition: logger.cxx:611
void logKeyInput(VclPtr< vcl::Window > const &xUIElement, const KeyEvent &rEvent)
Definition: logger.cxx:192
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
bool isDisposed() const
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true, bool bAlphaMaskTransparent=false)
Definition: virdev.cxx:405
bool mbToolBox
Definition: window.h:377
bool mbSysWin
Definition: window.h:322
bool mbFrame
Definition: window.h:319
bool mbMouseButtonUp
Definition: window.h:341
VclPtr< vcl::Window > mpNext
Definition: window.h:242
bool mbExtTextInput
Definition: window.h:373
bool mbActive
Definition: window.h:332
VclPtr< vcl::Window > mpFirstChild
Definition: window.h:237
bool mbMouseButtonDown
Definition: window.h:340
SalFrame * mpFrame
Definition: window.h:229
bool mbCallResize
Definition: window.h:348
bool mbDockWin
Definition: window.h:324
css::uno::Reference< css::uno::XInterface > mxDNDListenerContainer
Definition: window.h:394
bool mbKeyUp
Definition: window.h:343
VclPtr< vcl::Window > mpFrameWindow
Definition: window.h:231
ImplFrameData * mpFrameData
Definition: window.h:228
bool mbKeyInput
Definition: window.h:342
bool mbFloatWin
Definition: window.h:325
ImplPaintFlags mnPaintFlags
Definition: window.h:300
VclPtr< vcl::Window > mpClientWindow
Definition: window.h:234
vcl::Cursor * mpCursor
Definition: window.h:256
bool mbCallMove
Definition: window.h:347
bool mbAllResize
Definition: window.h:371
bool mbCommand
Definition: window.h:344
bool mbWaitSystemResize
Definition: window.h:349
VclPtr< vcl::Window > mpLastFocusWindow
Definition: window.h:244
VclPtr< vcl::Window > mpFirstOverlap
Definition: window.h:239
bool IsPresentationMode() const
Definition: wrkwin.hxx:89
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr bool IsEmpty() const
static sal_uInt64 GetSystemTicks()
const Point & GetPos() const
Definition: cursor.hxx:82
SAL_DLLPRIVATE void ImplShow()
Definition: cursor.cxx:308
SAL_DLLPRIVATE void ImplHide()
Definition: cursor.cxx:313
const Size & GetSize() const
Definition: cursor.hxx:85
bool IsVertical() const
Definition: font/font.cxx:921
bool IsMod1() const
Definition: keycod.hxx:56
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
sal_uInt16 GetModifier() const
Definition: keycod.hxx:52
bool IsShift() const
Definition: keycod.hxx:54
bool IsMod2() const
Definition: keycod.hxx:58
sal_uInt16 GetFullCode() const
Definition: keycod.hxx:46
constexpr sal_Int32 height() const
constexpr sal_Int32 width() const
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2865
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2806
SAL_DLLPRIVATE bool ImplIsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
Definition: stacking.cxx:700
bool IsReallyVisible() const
Definition: window2.cxx:1133
vcl::Window * GetParent() const
Definition: window2.cxx:1123
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1163
virtual void RequestHelp(const HelpEvent &rHEvt)
Definition: window.cxx:1869
SAL_DLLPRIVATE vcl::Window * ImplFindWindow(const Point &rFramePos)
Definition: stacking.cxx:629
virtual Selection GetSurroundingTextSelection() const
Definition: window.cxx:3782
tools::Long GetOutOffXPixel() const
Definition: window3.cxx:123
bool IsInputEnabled() const
Definition: window2.cxx:1153
void PaintImmediately()
Definition: paint.cxx:1268
const InputContext & GetInputContext() const
Definition: window2.cxx:1088
Point LogicToPixel(const Point &rLogicPt) const
Definition: window3.cxx:131
SAL_DLLPRIVATE void ImplCallDeactivateListeners(vcl::Window *)
Definition: window.cxx:3403
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
Definition: window2.cxx:293
WindowType GetType() const
Definition: window2.cxx:1000
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
Definition: window.cxx:3860
virtual void Tracking(const TrackingEvent &rTEvt)
Definition: window.cxx:1932
virtual void Command(const CommandEvent &rCEvt)
Definition: window.cxx:1923
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1036
void GrabFocus()
Definition: window.cxx:2976
virtual void MouseButtonDown(const MouseEvent &rMEvt)
Definition: mouse.cxx:420
vcl::Cursor * GetCursor() const
Definition: window2.cxx:1229
SAL_DLLPRIVATE bool CompatPreNotify(NotifyEvent &rNEvt)
Definition: window.cxx:3914
SAL_DLLPRIVATE void ImplNotifyIconifiedState(bool bIconified)
Definition: window.cxx:3636
WinBits GetStyle() const
Definition: window2.cxx:979
const AllSettings & GetSettings() const
Definition: window3.cxx:129
virtual void MouseButtonUp(const MouseEvent &rMEvt)
Definition: mouse.cxx:427
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners(NotifyEvent &rNEvt)
Definition: event.cxx:382
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1805
SAL_DLLPRIVATE bool ImplSetClipFlag(bool bSysObjOnlySmaller=false)
tools::Long GetOutOffYPixel() const
Definition: window3.cxx:124
virtual OUString GetSurroundingText() const
Definition: window.cxx:3777
SAL_DLLPRIVATE void ImplCallMouseMove(sal_uInt16 nMouseCode, bool bModChanged=false)
Definition: mouse.cxx:135
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:419
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
Definition: window2.cxx:911
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
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:3597
SAL_DLLPRIVATE void ImplCallMove()
Definition: event.cxx:532
SAL_DLLPRIVATE ImplWinData * ImplGetWinData() const
Definition: window.cxx:1226
virtual bool DeleteSurroundingText(const Selection &rSelection)
Definition: window.cxx:3811
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
Definition: window.hxx:528
virtual void MouseMove(const MouseEvent &rMEvt)
Definition: mouse.cxx:414
SAL_DLLPRIVATE void CompatLoseFocus()
Definition: window.cxx:3890
SalFrame * ImplGetFrame() const
Definition: window2.cxx:879
bool IsRTLEnabled() const
Definition: window3.cxx:127
virtual Size GetSizePixel() const
Definition: window.cxx:2402
Size GetOutputSizePixel() const
Definition: window3.cxx:89
virtual void Deactivate()
Definition: window.cxx:1839
Point GetPointerPosPixel()
Definition: mouse.cxx:540
SAL_DLLPRIVATE ImplFrameData * ImplGetFrameData()
Definition: window2.cxx:874
const tools::Rectangle * GetCursorRect() const
Definition: window.cxx:2133
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:947
css::uno::Reference< css::datatransfer::dnd::XDragSource > GetDragSource()
Definition: mouse.cxx:711
bool IsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
Definition: stacking.cxx:1124
SAL_DLLPRIVATE void ImplCallResize()
Definition: event.cxx:517
bool IsVisible() const
Definition: window2.cxx:1128
tools::Long GetCursorExtTextInputWidth() const
Definition: window.cxx:2140
virtual void KeyUp(const KeyEvent &rKEvt)
Definition: window.cxx:1822
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2855
SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion(const vcl::Region &rRegion)
Definition: paint.cxx:750
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:866
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2812
bool IsMenuFloatingWindow() const
Definition: window2.cxx:1033
SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const
Definition: mouse.cxx:93
void EndExtTextInput()
Definition: window.cxx:2106
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:937
bool IsEnabled() const
Definition: window2.cxx:1148
void EndAutoScroll()
Definition: window2.cxx:367
ExtTextInputAttr
ShowDialogId
CommandWheelMode
CommandEventId
#define DBG_ASSERT(sCon, aError)
#define DBG_TESTSOLARMUTEX()
#define MOUSE_LEFT
Definition: event.hxx:102
#define MOUSE_MIDDLE
Definition: event.hxx:103
#define MOUSE_RIGHT
Definition: event.hxx:104
NotifyEventType
Definition: event.hxx:276
DataChangedEventType
Definition: event.hxx:341
MouseEventModifiers
Definition: event.hxx:80
HelpEventMode
Definition: event.hxx:186
void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:563
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
constexpr sal_uInt16 KEY_F2
Definition: keycodes.hxx:84
constexpr sal_uInt16 KEY_CONTEXTMENU
Definition: keycodes.hxx:146
constexpr sal_uInt16 KEY_MOD2
Definition: keycodes.hxx:32
constexpr sal_uInt16 KEY_ESCAPE
Definition: keycodes.hxx:120
constexpr sal_uInt16 KEY_MOD1
Definition: keycodes.hxx:31
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
constexpr sal_uInt16 KEY_DECIMAL
Definition: keycodes.hxx:150
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
constexpr sal_uInt16 KEY_F1
Definition: keycodes.hxx:83
constexpr sal_uInt16 KEY_MOD3
Definition: keycodes.hxx:33
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
constexpr sal_uInt16 KEY_HELP
Definition: keycodes.hxx:148
constexpr sal_uInt16 KEY_SHIFT
Definition: keycodes.hxx:30
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
void ImplDeletePrnQueueList()
Definition: print.cxx:381
QPRO_FUNC_TYPE nType
SalEvent
Definition: salwtype.hxx:46
@ EndExtTextInput
@ InputContextChange
@ InputLanguageChange
@ DeleteSurroundingTextRequest
@ ExtTextInputPos
@ ExternalGesture
@ ExternalKeyInput
@ GestureLongPress
@ SurroundingTextSelectionChange
@ MouseButtonDown
@ ExternalMouseButtonDown
@ StartReconversion
@ DisplayChanged
@ MenuDeactivate
@ MenuButtonCommand
@ QueryCharPosition
@ PrinterChanged
@ SurroundingTextRequest
@ ExternalMouseMove
@ ExternalMouseButtonUp
@ SettingsChanged
MouseMiddleButtonAction
Definition: settings.hxx:73
sal_uIntPtr sal_uLong
VclPtr< vcl::Window > mpTrackWin
Definition: window.h:139
bool mbDragging
Definition: window.h:179
tools::Long mnBeforeLastMouseX
Definition: window.h:149
Idle maResizeIdle
Definition: window.h:132
bool mbNeedSysWindow
Definition: window.h:165
sal_uInt64 mnMouseDownTime
Definition: window.h:156
bool mbInMouseMove
Definition: window.h:162
bool mbStartFocusState
Definition: window.h:167
MouseEventModifiers mnMouseMode
Definition: window.h:160
VclPtr< VirtualDevice > mpBuffer
Buffer for the double-buffering.
Definition: window.h:180
bool mbStartDragCalled
Definition: window.h:164
tools::Long mnFirstMouseY
Definition: window.h:152
tools::Long mnLastMouseY
Definition: window.h:148
sal_uInt16 mnMouseCode
Definition: window.h:159
VclPtr< vcl::Window > mpMouseMoveWin
Definition: window.h:137
tools::Long mnBeforeLastMouseY
Definition: window.h:150
tools::Long mnLastMouseX
Definition: window.h:147
ImplSVEvent * mnFocusId
Definition: window.h:145
tools::Long mnLastMouseWinY
Definition: window.h:154
VclPtr< vcl::Window > mpMouseDownWin
Definition: window.h:138
bool mbMouseIn
Definition: window.h:163
sal_uInt16 mnClickCount
Definition: window.h:157
tools::Long mnFirstMouseX
Definition: window.h:151
bool mbMinimized
Definition: window.h:166
VclPtr< vcl::Window > mpFocusWin
Definition: window.h:136
bool mbHasFocus
Definition: window.h:161
sal_uInt16 mnFirstMouseCode
Definition: window.h:158
bool mbInternalDragGestureRecognizer
Definition: window.h:178
tools::Long mnLastMouseWinX
Definition: window.h:153
sal_uInt64 mnLastInputTime
Definition: svdata.hxx:158
VclPtr< PopupMenu > mpActivePopupMenu
Definition: svdata.hxx:156
ImplAccelManager * mpAccelMgr
Definition: svdata.hxx:150
ImplSVWinData * mpWinData
Definition: svdata.hxx:400
ImplSVAppData maAppData
Definition: svdata.hxx:397
bool mbCall
Definition: svdata.hxx:466
Link< void *, void > maLink
Definition: svdata.hxx:463
void * mpData
Definition: svdata.hxx:462
bool mbRequestingHelp
Definition: svdata.hxx:303
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:304
bool mbKeyboardHelp
Definition: svdata.hxx:302
bool mbSetKeyboardHelp
Definition: svdata.hxx:301
bool mbExtHelpMode
Definition: svdata.hxx:297
bool mbBalloonHelp
Definition: svdata.hxx:299
bool mbQuickHelp
Definition: svdata.hxx:300
VclPtr< vcl::Window > mpLastWheelWindow
Definition: svdata.hxx:261
VclPtr< FloatingWindow > mpFirstFloat
Definition: svdata.hxx:254
std::unique_ptr< AutoTimer > mpTrackTimer
Definition: svdata.hxx:258
StartTrackingFlags mnTrackFlags
Definition: svdata.hxx:264
SalWheelMouseEvent maLastWheelEvent
Definition: svdata.hxx:262
VclPtr< vcl::Window > mpAutoScrollWin
Definition: svdata.hxx:260
VclPtr< vcl::Window > mpFocusWin
Definition: svdata.hxx:251
VclPtr< vcl::Window > mpCaptureWin
Definition: svdata.hxx:252
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:257
VclPtr< vcl::Window > mpExtTextInputWin
Definition: svdata.hxx:256
std::vector< VclPtr< Dialog > > mpExecuteDialogs
Stack of dialogs that are Execute()'d - the last one is the top most one.
Definition: svdata.hxx:255
tools::Long mnCompositionCharRects
Definition: window.h:113
std::unique_ptr< tools::Rectangle[]> mpCompositionCharRects
Definition: window.h:112
std::optional< OUString > mpExtOldText
Definition: window.h:104
bool mbMouseOver
Definition: window.h:120
std::unique_ptr< ExtTextInputAttr[]> mpExtOldAttrAry
Definition: window.h:106
bool mbVertical
Definition: window.h:110
sal_uInt8 mnCursorFlags
Definition: salwtype.hxx:183
sal_Int32 mnCursorPos
Definition: salwtype.hxx:182
const ExtTextInputAttr * mpTextAttr
Definition: salwtype.hxx:181
tools::Long mnExtWidth
Definition: salwtype.hxx:192
PanningOrientation meOrientation
Definition: salwtype.hxx:264
GestureEventPanType meEventType
Definition: salwtype.hxx:263
tools::Long mnY
Definition: salwtype.hxx:267
tools::Long mnX
Definition: salwtype.hxx:266
sal_uInt16 mnRepeat
Definition: salwtype.hxx:127
sal_uInt16 mnCode
Definition: salwtype.hxx:125
sal_uInt16 mnCharCode
Definition: salwtype.hxx:126
ModKeyFlags mnModKeyCode
Definition: salwtype.hxx:146
sal_uInt16 mnCode
Definition: salwtype.hxx:145
sal_uInt16 mnId
Definition: salwtype.hxx:133
void * mpMenu
Definition: salwtype.hxx:134
sal_uInt16 mnButton
Definition: salwtype.hxx:117
tools::Long mnBoundWidth
Definition: salwtype.hxx:153
bool mbImmediateUpdate
Definition: salwtype.hxx:155
tools::Long mnBoundY
Definition: salwtype.hxx:152
tools::Long mnBoundX
Definition: salwtype.hxx:151
tools::Long mnBoundHeight
Definition: salwtype.hxx:154
tools::Long mnCursorBoundHeight
Definition: salwtype.hxx:228
tools::Long mnCursorBoundWidth
Definition: salwtype.hxx:227
tools::Long mnCursorBoundX
Definition: salwtype.hxx:225
tools::Long mnCursorBoundY
Definition: salwtype.hxx:226
tools::Long mnDelta
Definition: salwtype.hxx:167
tools::Long mnNotchDelta
Definition: salwtype.hxx:168
Application * GetpApp()
Definition: svapp.cxx:154
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:507
sal_uInt16 sal_Unicode
#define SAL_MAX_UINT32
FloatWinPopupFlags
Definition: vclenum.hxx:323
VclEventId
Definition: vclevent.hxx:38
static void ImplHandleSurroundingTextRequest(vcl::Window *pWindow, OUString &rText, Selection &rSelRange)
Definition: winproc.cxx:2530
static bool ImplHandleGestureRotateEvent(vcl::Window *pWindow, const SalGestureRotateEvent &rEvent)
Definition: winproc.cxx:1874
IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void *, void)
Definition: winproc.cxx:2035
static void ImplHandleSalSettings(SalEvent nEvent)
Definition: winproc.cxx:2452
static bool ImplHandleGestureEvent(vcl::Window *pWindow, const SalGestureEvent &rEvent)
Definition: winproc.cxx:1818
static void DelayedCloseEventLink(void *pCEvent, void *)
Definition: winproc.cxx:2212
static void ImplHandleSurroundingTextSelectionChange(vcl::Window *pWindow, sal_uLong nStart, sal_uLong nEnd)
Definition: winproc.cxx:2591
MouseEventModifiers ImplGetMouseButtonMode(SalMouseEvent const *pEvent)
Definition: winproc.cxx:2306
static bool ImplHandleMenuEvent(vcl::Window const *pWindow, SalMenuEvent *pEvent, SalEvent nEvent)
Definition: winproc.cxx:2364
static bool ImplCallCommand(const VclPtr< vcl::Window > &pChild, CommandEventId nEvt, void const *pData=nullptr, bool bMouse=false, Point const *pPos=nullptr)
Definition: winproc.cxx:203
static void ImplSetMousePointer(vcl::Window const *pChild)
Definition: winproc.cxx:195
static void ImplHandleLoseFocus(vcl::Window *pWindow)
Definition: winproc.cxx:2159
static bool ImplHandleSalMouseMove(vcl::Window *pWindow, SalMouseEvent const *pEvent)
Definition: winproc.cxx:2330
static bool ImplHandleGestureZoomEvent(vcl::Window *pWindow, const SalGestureZoomEvent &rEvent)
Definition: winproc.cxx:1846
static void ImplHandleMove(vcl::Window *pWindow)
Definition: winproc.cxx:1986
static void ContextMenuEventLink(void *pCEvent, void *)
Definition: winproc.cxx:257
static void ImplHandleGetFocus(vcl::Window *pWindow)
Definition: winproc.cxx:2140
static bool ImplHandleSalMouseButtonDown(vcl::Window *pWindow, SalMouseEvent const *pEvent)
Definition: winproc.cxx:2338
static void ImplHandleMouseHelpRequest(vcl::Window *pChild, const Point &rMousePos)
Definition: winproc.cxx:165
static bool ImplHandleSwipe(vcl::Window *pWindow, const SalGestureSwipeEvent &rEvt)
Definition: winproc.cxx:1764
static void ImplHandleSalKeyMod(vcl::Window *pWindow, SalKeyModEvent const *pEvent)
Definition: winproc.cxx:2407
bool ImplHandleMouseEvent(const VclPtr< vcl::Window > &xWindow, NotifyEventType nSVEvent, bool bMouseLeave, tools::Long nX, tools::Long nY, sal_uInt64 nMsgTime, sal_uInt16 nCode, MouseEventModifiers nMode)
Definition: winproc.cxx:268
static bool ImplHandleInputContextChange(vcl::Window *pWindow)
Definition: winproc.cxx:1492
static bool shouldReusePreviousMouseWindow(const SalWheelMouseEvent &rPrevEvt, const SalWheelMouseEvent &rEvt)
Definition: winproc.cxx:1531
static bool ImplHandleSalMouseLeave(vcl::Window *pWindow, SalMouseEvent const *pEvent)
Definition: winproc.cxx:2322
static bool ImplHandleKey(vcl::Window *pWindow, NotifyEventType nSVEvent, sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, bool bForward)
Definition: winproc.cxx:1067
static void ImplHandleExtTextInputPos(vcl::Window *pWindow, tools::Rectangle &rRect, tools::Long &rInputWidth, bool *pVertical)
Definition: winproc.cxx:1446
#define IMPL_MIN_NEEDSYSWIN
Definition: winproc.cxx:65
static void ImplHandleInputLanguageChange(vcl::Window *pWindow)
Definition: winproc.cxx:2442
static bool ImplHandleLongPress(vcl::Window *pWindow, const SalGestureLongPressEvent &rEvt)
Definition: winproc.cxx:1790
static void ImplHandleSalQueryCharPosition(vcl::Window *pWindow, SalQueryCharPositionEvent *pEvt)
Definition: winproc.cxx:2610
static bool ImplCallWheelCommand(const VclPtr< vcl::Window > &pWindow, const Point &rPos, const CommandWheelData *pWheelData)
Definition: winproc.cxx:1499
static bool ImplHandleEndExtTextInput()
Definition: winproc.cxx:1427
static void KillOwnPopups(vcl::Window const *pWindow)
Definition: winproc.cxx:1898
static bool ImplHandleShowDialog(vcl::Window *pWindow, ShowDialogId nDialogId)
Definition: winproc.cxx:2515
static bool acceptableWheelScrollTarget(const vcl::Window *pMouseWindow)
Definition: winproc.cxx:1520
MouseEventModifiers ImplGetMouseMoveMode(SalMouseEvent const *pEvent)
Definition: winproc.cxx:2294
bool ImplLOKHandleMouseEvent(const VclPtr< vcl::Window > &xWindow, NotifyEventType nEvent, bool, tools::Long nX, tools::Long nY, sal_uInt64, sal_uInt16 nCode, MouseEventModifiers nMode, sal_uInt16 nClicks)
Definition: winproc.cxx:808
static void ImplActivateFloatingWindows(vcl::Window const *pWindow, bool bActive)
Definition: winproc.cxx:2017
static vcl::Window * ImplGetKeyInputWindow(vcl::Window *pWindow)
Definition: winproc.cxx:1010
bool ImplCallPreNotify(NotifyEvent &rEvt)
Definition: winproc.cxx:67
static void ImplHandleStartReconversion(vcl::Window *pWindow)
Definition: winproc.cxx:2603
static bool ImplHandleMouseFloatMode(vcl::Window *pChild, const Point &rMousePos, sal_uInt16 nCode, NotifyEventType nSVEvent, bool bMouseLeave)
Definition: winproc.cxx:72
static void ImplHandleSalDeleteSurroundingTextRequest(vcl::Window *pWindow, SalSurroundingTextSelectionChangeEvent *pEvt)
Definition: winproc.cxx:2574
static void ImplHandleSalSurroundingTextRequest(vcl::Window *pWindow, SalSurroundingTextRequestEvent *pEvt)
Definition: winproc.cxx:2551
static bool ImplHandleExtTextInput(vcl::Window *pWindow, const OUString &rText, const ExtTextInputAttr *pTextAttr, sal_Int32 nCursorPos, sal_uInt16 nCursorFlags)
Definition: winproc.cxx:1336
static bool ImplHandleSalMouseButtonUp(vcl::Window *pWindow, SalMouseEvent const *pEvent)
Definition: winproc.cxx:2351
static void ImplHandlePaint(vcl::Window *pWindow, const tools::Rectangle &rBoundRect, bool bImmediateUpdate)
Definition: winproc.cxx:1880
static bool ImplHandleWheelEvent(vcl::Window *pWindow, const SalWheelMouseEvent &rEvt)
Definition: winproc.cxx:1738
static void ImplHandleClose(const vcl::Window *pWindow)
Definition: winproc.cxx:2227
bool ImplWindowFrameProc(vcl::Window *_pWindow, SalEvent nEvent, const void *pEvent)
Definition: winproc.cxx:2653
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:1912
static void ImplHandleUserEvent(ImplSVEvent *pSVEvent)
Definition: winproc.cxx:2281
static void ImplHandleMoveResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:2011
static void ImplHandleSalExtTextInputPos(vcl::Window *pWindow, SalExtTextInputPosEvent *pEvt)
Definition: winproc.cxx:2495
WinBits const WB_MOVEABLE
Definition: wintypes.hxx:122
WinBits const WB_OWNERDRAWDECORATION
Definition: wintypes.hxx:173
WinBits const WB_SIZEABLE
Definition: wintypes.hxx:117