From 31d902d3c00fdc5f088aff433b7ebf308a718339 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Nov 2014 12:30:39 +0200 Subject: fdo#84938: replace MOUSE_ modifier constants with enum and make the two categories of constants non-overlapping, we really don't need to risk confusion in order to save 6 bits in a data structure like this. Change-Id: I2251195d8e45ed04e2a89e47ae9c3e52cf0475c0 --- avmedia/source/viewer/mediaevent_impl.cxx | 8 +-- basctl/source/basicide/bastypes.cxx | 2 +- .../controller/main/ChartController_TextEdit.cxx | 2 +- .../controller/main/ChartController_Window.cxx | 2 +- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 4 +- dbaccess/source/ui/control/toolboxcontroller.cxx | 2 +- extensions/source/bibliography/toolbar.cxx | 2 +- include/svx/svdview.hxx | 10 ++-- include/vcl/event.hxx | 61 ++++++++++++---------- o3tl/qa/test-typed_flags.cxx | 2 - sc/source/ui/drawfunc/fudraw.cxx | 2 +- sc/source/ui/drawfunc/fupoor.cxx | 2 +- sc/source/ui/drawfunc/futext.cxx | 2 +- sc/source/ui/navipi/navipi.cxx | 2 +- sc/source/ui/view/gridwin.cxx | 4 +- sc/source/ui/view/gridwin5.cxx | 2 +- sd/source/ui/func/fudraw.cxx | 2 +- sd/source/ui/func/fuediglu.cxx | 10 ++-- sd/source/ui/func/fupoor.cxx | 4 +- sd/source/ui/func/fusel.cxx | 10 ++-- sfx2/source/statbar/stbitem.cxx | 6 +-- svtools/source/brwbox/brwbox2.cxx | 9 ++-- svtools/source/brwbox/datwin.cxx | 2 +- svtools/source/contnr/treelistbox.cxx | 2 +- svtools/source/control/tabbar.cxx | 4 +- svx/source/dialog/connctrl.cxx | 2 +- svx/source/fmcomp/gridcell.cxx | 2 +- svx/source/svdraw/svdview.cxx | 2 +- toolkit/source/awt/vclxwindow.cxx | 4 +- vcl/inc/window.h | 5 +- vcl/source/window/mouse.cxx | 6 +-- vcl/source/window/mouseevent.cxx | 6 +-- vcl/source/window/toolbox.cxx | 6 +-- vcl/source/window/window.cxx | 2 +- vcl/source/window/window2.cxx | 10 ++-- vcl/source/window/winproc.cxx | 33 ++++++------ 36 files changed, 126 insertions(+), 110 deletions(-) diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx index 2db883172d5e..86e18175101c 100644 --- a/avmedia/source/viewer/mediaevent_impl.cxx +++ b/avmedia/source/viewer/mediaevent_impl.cxx @@ -107,7 +107,7 @@ void SAL_CALL MediaEventListenersImpl::mousePressed( const ::com::sun::star::awt { MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), sal::static_int_cast< sal_uInt16 >(e.ClickCount), - 0, + MouseEventModifiers::NONE, ( ( e.Buttons & 1 ) ? MOUSE_LEFT : 0 ) | ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) | ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ), @@ -128,7 +128,7 @@ void SAL_CALL MediaEventListenersImpl::mouseReleased( const ::com::sun::star::aw { MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), sal::static_int_cast< sal_uInt16 >(e.ClickCount), - 0, + MouseEventModifiers::NONE, ( ( e.Buttons & 1 ) ? MOUSE_LEFT : 0 ) | ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) | ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ), @@ -173,7 +173,7 @@ void SAL_CALL MediaEventListenersImpl::mouseDragged( const ::com::sun::star::awt if( mpNotifyWindow ) { - MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, 0, e.Buttons, e.Modifiers ); + MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers ); Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); } } @@ -188,7 +188,7 @@ void SAL_CALL MediaEventListenersImpl::mouseMoved( const ::com::sun::star::awt:: if( mpNotifyWindow ) { - MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, 0, e.Buttons, e.Modifiers ); + MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers ); Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); } } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 55a3dc4b2976..169902a2896c 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -483,7 +483,7 @@ void TabBar::Command( const CommandEvent& rCEvt ) if ( rCEvt.IsMouseEvent() ) // select right tab { Point aP = PixelToLogic( aPos ); - MouseEvent aMouseEvent( aP, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ); + MouseEvent aMouseEvent( aP, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT ); ::TabBar::MouseButtonDown( aMouseEvent ); // base class } diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index 0cb9648ae90b..5fe2635fc021 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -90,7 +90,7 @@ void ChartController::StartTextEdit( const Point* pMousePixel ) OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView(); if ( pOutlinerView ) { - MouseEvent aEditEvt( *pMousePixel, 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 ); + MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 ); pOutlinerView->MouseButtonDown( aEditEvt ); pOutlinerView->MouseButtonUp( aEditEvt ); } diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index c367f6563e40..fb1132ce2620 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -549,7 +549,7 @@ IMPL_LINK_NOARG(ChartController, DoubleClickWaitingHdl) MouseEvent aMouseEvent( aPointerState.maPos, 1/*nClicks*/, - 0/*nMode*/, + MouseEventModifiers::NONE, static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/, 0/*nModifier*/ ); impl_SetMousePointer( aMouseEvent ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 75c51d117676..184fb484161f 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1176,7 +1176,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/) // simulate a mouse move (so the "down" state is really painted) Point aPoint = m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft(); - MouseEvent aMove( aPoint, 0, MOUSE_SIMPLEMOVE | MOUSE_SYNTHETIC ); + MouseEvent aMove( aPoint, 0, MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::SYNTHETIC ); m_aTBPreview.MouseMove( aMove ); m_aTBPreview.Update(); @@ -1200,7 +1200,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/) sal_uInt16 nSelectedAction = aMenu->Execute(&m_aTBPreview, m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW )); // "cleanup" the toolbox state - MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); + MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); m_aTBPreview.MouseMove( aLeave ); m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false); if ( nSelectedAction ) diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 5bbd3b0abe5c..cb6d3061ad46 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -234,7 +234,7 @@ namespace dbaui sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); // "cleanup" the toolbox state Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft(); - MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); + MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); pToolBox->MouseMove( aLeave ); pToolBox->SetItemDown( m_nToolBoxId, false); diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index b32738e8fda1..d4f433ec763d 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -498,7 +498,7 @@ IMPL_LINK( BibToolBar, MenuHdl, ToolBox*, /*pToolbox*/) } Point aPoint; - MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); + MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); MouseMove( aLeave ); SetItemDown(TBC_BT_AUTOFILTER,false); diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index fca5eb484505..2a754d1f0133 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -101,11 +101,11 @@ struct SVX_DLLPUBLIC SdrViewEvent SdrHdlKind eHdlKind; SdrCreateCmd eEndCreateCmd; // auch fuer EndInsPoint - sal_uInt16 nMouseClicks; - sal_uInt16 nMouseMode; - sal_uInt16 nMouseCode; - sal_uInt16 nHlplIdx; - sal_uInt16 nGlueId; + sal_uInt16 nMouseClicks; + MouseEventModifiers nMouseMode; + sal_uInt16 nMouseCode; + sal_uInt16 nHlplIdx; + sal_uInt16 nGlueId; bool bMouseDown : 1; bool bMouseUp : 1; diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx index 3cd5f8ac1708..76e609dd0211 100644 --- a/include/vcl/event.hxx +++ b/include/vcl/event.hxx @@ -82,20 +82,27 @@ inline KeyEvent::KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode, // - MouseEvent-Types - -// Maus-Move-Modi -#define MOUSE_SIMPLEMOVE ((sal_uInt16)0x0001) -#define MOUSE_DRAGMOVE ((sal_uInt16)0x0002) -#define MOUSE_DRAGCOPY ((sal_uInt16)0x0004) -#define MOUSE_ENTERWINDOW ((sal_uInt16)0x0010) -#define MOUSE_LEAVEWINDOW ((sal_uInt16)0x0020) -#define MOUSE_SYNTHETIC ((sal_uInt16)0x0040) -#define MOUSE_MODIFIERCHANGED ((sal_uInt16)0x0080) - -// Maus-Button-Down/Up-Modi -#define MOUSE_SIMPLECLICK ((sal_uInt16)0x0001) -#define MOUSE_SELECT ((sal_uInt16)0x0002) -#define MOUSE_MULTISELECT ((sal_uInt16)0x0004) -#define MOUSE_RANGESELECT ((sal_uInt16)0x0008) +enum class MouseEventModifiers +{ + NONE = 0, + // mouse move modifiers + SIMPLEMOVE = 0x0001, + DRAGMOVE = 0x0002, + DRAGCOPY = 0x0004, + ENTERWINDOW = 0x0010, + LEAVEWINDOW = 0x0020, + SYNTHETIC = 0x0040, + MODIFIERCHANGED = 0x0080, + // mouse up/down-button modifiers + SIMPLECLICK = 0x0100, + SELECT = 0x0200, + MULTISELECT = 0x0400, + RANGESELECT = 0x0800 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} // Maus-Buttons #define MOUSE_LEFT ((sal_uInt16)0x0001) @@ -109,34 +116,34 @@ inline KeyEvent::KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode, class VCL_DLLPUBLIC MouseEvent { private: - Point maPos; - sal_uInt16 mnMode; + Point maPos; + MouseEventModifiers mnMode; sal_uInt16 mnClicks; sal_uInt16 mnCode; public: explicit MouseEvent(); explicit MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1, - sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0, + MouseEventModifiers nMode = MouseEventModifiers::NONE, sal_uInt16 nButtons = 0, sal_uInt16 nModifier = 0 ); const Point& GetPosPixel() const { return maPos; } - sal_uInt16 GetMode() const { return mnMode; } + MouseEventModifiers GetMode() const { return mnMode; } /** inits this vcl KeyEvent with all settings from the given awt event **/ MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ); - sal_uInt16 GetClicks() const { return mnClicks; } + sal_uInt16 GetClicks() const { return mnClicks; } bool IsEnterWindow() const - { return ((mnMode & MOUSE_ENTERWINDOW) != 0); } + { return bool(mnMode & MouseEventModifiers::ENTERWINDOW); } bool IsLeaveWindow() const - { return ((mnMode & MOUSE_LEAVEWINDOW) != 0); } + { return bool(mnMode & MouseEventModifiers::LEAVEWINDOW); } bool IsSynthetic() const - { return ((mnMode & MOUSE_SYNTHETIC) != 0); } + { return bool(mnMode & MouseEventModifiers::SYNTHETIC); } bool IsModifierChanged() const - { return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); } + { return bool(mnMode & MouseEventModifiers::MODIFIERCHANGED); } - sal_uInt16 GetButtons() const + sal_uInt16 GetButtons() const { return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); } bool IsLeft() const { return ((mnCode & MOUSE_LEFT) != 0); } @@ -145,7 +152,7 @@ public: bool IsRight() const { return ((mnCode & MOUSE_RIGHT) != 0); } - sal_uInt16 GetModifier() const + sal_uInt16 GetModifier() const { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); } bool IsShift() const { return ((mnCode & KEY_SHIFT) != 0); } @@ -159,13 +166,13 @@ public: inline MouseEvent::MouseEvent() { - mnMode = 0; + mnMode = MouseEventModifiers::NONE; mnClicks = 0; mnCode = 0; } inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks, - sal_uInt16 nMode, + MouseEventModifiers nMode, sal_uInt16 nButtons, sal_uInt16 nModifier ) : maPos( rPos ) { diff --git a/o3tl/qa/test-typed_flags.cxx b/o3tl/qa/test-typed_flags.cxx index 3fe327e55b9e..d2a4154fd71b 100644 --- a/o3tl/qa/test-typed_flags.cxx +++ b/o3tl/qa/test-typed_flags.cxx @@ -47,8 +47,6 @@ public: nHint &= ConfigurationChangedHint::ONE; CPPUNIT_ASSERT( bool(nHint &= ConfigurationChangedHint::ONE) ); - ConfigurationChangedHint nHint2 = nHint & ~(ConfigurationChangedHint::ONE | ConfigurationChangedHint::TWO); - } // Change the following lines only, if you add, remove or rename diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 34cea9993cd3..009c2b55aae0 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -707,7 +707,7 @@ void FuDraw::Deactivate() static bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, vcl::Window* pWindow ) { SdrViewEvent aVEvt; - MouseEvent aMEvt( rPosPixel, 1, 0, MOUSE_LEFT ); + MouseEvent aMEvt( rPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT ); SdrHitKind eHit = pView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt ); if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL ) diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index dfad06aa87c7..979e7b6e2cec 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -133,7 +133,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, ScrollHdl) // use remembered MouseButton state to create correct // MouseEvents for this artificial MouseMove. - MouseMove(MouseEvent(aPosPixel, 1, 0, GetMouseButtonCode())); + MouseMove(MouseEvent(aPosPixel, 1, MouseEventModifiers::NONE, GetMouseButtonCode())); return 0; } diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index e3be9577a7f2..0d76c7eab6d6 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -750,7 +750,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, { if ( pMousePixel ) { - MouseEvent aEditEvt( *pMousePixel, 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 ); + MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 ); pOLV->MouseButtonDown(aEditEvt); pOLV->MouseButtonUp(aEditEvt); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index efd1e80df588..b3a1f190f502 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -405,7 +405,7 @@ IMPL_LINK_NOARG(CommandToolBox, ToolBoxDropdownClickHdl) // den gehighlighteten Button aufheben Point aPoint; - MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); + MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); MouseMove( aLeave ); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4e0fb78b4b34..e8defd1e4e88 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2274,7 +2274,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) { // Text-Cursor gleich an die geklickte Stelle setzen EditView* pEditView = pViewData->GetEditView( eWhich ); - MouseEvent aEditEvt( rMEvt.GetPosPixel(), 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 ); + MouseEvent aEditEvt( rMEvt.GetPosPixel(), 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 ); pEditView->MouseButtonDown( aEditEvt ); pEditView->MouseButtonUp( aEditEvt ); } @@ -2472,7 +2472,7 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt ) nButtonDown = 0; nMouseStatus = SC_GM_NONE; ReleaseMouse(); - pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ) ); + pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT ) ); return; } } diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 9453104a63b3..8bdd9892519a 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -288,7 +288,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) if ( pDrView ) // URL / Image-Map { SdrViewEvent aVEvt; - MouseEvent aMEvt( aPosPixel, 1, 0, MOUSE_LEFT ); + MouseEvent aMEvt( aPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT ); SdrHitKind eHit = pDrView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt ); if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL ) diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 95755160dde5..613e74fe0827 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -759,7 +759,7 @@ bool FuDraw::RequestHelp(const HelpEvent& rHEvt) { SdrViewEvent aVEvt; - MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, 0, MOUSE_LEFT); + MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, MouseEventModifiers::NONE, MOUSE_LEFT); SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt); diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index 889a2bf19df5..74e1f5974c3e 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -309,7 +309,7 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt) Point ePoint = aPoint + Point(nX,nY); mpWindow->SetPointerPosPixel(ePoint); //simulate mouse move action - MouseEvent eMevt(ePoint,1,2,MOUSE_LEFT, 0); + MouseEvent eMevt(ePoint, 1, MouseEventModifiers::DRAGMOVE, MOUSE_LEFT, 0); MouseMove(eMevt); oldPoint = ePoint; bBeginInsertPoint = true; @@ -324,14 +324,18 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt) { mpWindow->SetPointerPosPixel(oldPoint); //simulate mouse button down action - MouseEvent aMevt(oldPoint,1,3,MOUSE_LEFT,KEY_SHIFT); + MouseEvent aMevt(oldPoint, 1, + MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::DRAGMOVE, + MOUSE_LEFT, KEY_SHIFT); // MT IA2: Not used? // sal_uInt16 ubuttons = aMevt.GetButtons(); // sal_uInt16 uMod = aMevt.GetModifier(); MouseButtonDown(aMevt); mpWindow->CaptureMouse(); //simulate mouse button up action - MouseEvent rMEvt(oldPoint+Point(0,0),1,17, MOUSE_LEFT, KEY_SHIFT); + MouseEvent rMEvt(oldPoint+Point(0,0), 1, + MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::ENTERWINDOW, + MOUSE_LEFT, KEY_SHIFT); MouseButtonUp(rMEvt); bReturn= true; } diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index c98211e1bcc5..1f19ac34ccbd 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -180,7 +180,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, ScrollHdl) // use remembered MouseButton state to create correct // MouseEvents for this artificial MouseMove. - MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode())); + MouseMove(MouseEvent(aPnt, 1, MouseEventModifiers::NONE, GetMouseButtonCode())); return 0; } @@ -989,7 +989,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, DelayHdl) // use remembered MouseButton state to create correct // MouseEvents for this artificial MouseMove. - MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode())); + MouseMove(MouseEvent(aPnt, 1, MouseEventModifiers::NONE, GetMouseButtonCode())); return 0; } diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 51d134e60364..0e3c0ded7220 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -950,7 +950,7 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) Point ePoint = aPoint + Point(nX,nY); mpWindow->SetPointerPosPixel(ePoint); //simulate mouse move action - MouseEvent eMevt(ePoint,1,2, MOUSE_LEFT, 0); + MouseEvent eMevt(ePoint, 1, MouseEventModifiers::DRAGMOVE, MOUSE_LEFT, 0); MouseMove(eMevt); oldPoint = ePoint; bMovedToCenterPoint = true; @@ -964,7 +964,9 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) if(!bBeginInsertPoint) { //simulate mouse button down action - MouseEvent aMevt(oldPoint,1,3, MOUSE_LEFT, KEY_SHIFT); + MouseEvent aMevt(oldPoint, 1, + MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::DRAGMOVE, + MOUSE_LEFT, KEY_SHIFT); MouseButtonDown(aMevt); mpWindow->CaptureMouse(); bBeginInsertPoint = true; @@ -972,7 +974,9 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) else { //simulate mouse button up action - MouseEvent rMEvt(oldPoint,1,17, MOUSE_LEFT, KEY_SHIFT); + MouseEvent rMEvt(oldPoint, 1, + MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::ENTERWINDOW, + MOUSE_LEFT, KEY_SHIFT); MouseButtonUp(rMEvt); bBeginInsertPoint = false; } diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 70e828000a4d..27ba304cea87 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -324,7 +324,7 @@ throw ( uno::RuntimeException, std::exception ) ::MouseEvent aMouseEvent( aPos, (sal_uInt16)rMouseEvent.ClickCount, - 0, + MouseEventModifiers::NONE, convertAwtToVCLMouseButtons( rMouseEvent.Buttons ), 0 ); @@ -342,7 +342,7 @@ throw (uno::RuntimeException, std::exception) ::MouseEvent aMouseEvent( aPos, (sal_uInt16)rMouseEvent.ClickCount, - 0, + MouseEventModifiers::NONE, convertAwtToVCLMouseButtons( rMouseEvent.Buttons ), 0 ); return MouseMove( aMouseEvent ); @@ -359,7 +359,7 @@ throw ( uno::RuntimeException, std::exception ) ::MouseEvent aMouseEvent( aPos, (sal_uInt16)rMouseEvent.ClickCount, - 0, + MouseEventModifiers::NONE, convertAwtToVCLMouseButtons( rMouseEvent.Buttons ), 0 ); return MouseButtonUp( aMouseEvent ); diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 64abdb2072e3..7e7e7eab5e2f 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1582,7 +1582,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) DoubleClick( rEvt ); } // selections - else if ( ( rEvt.GetMode() & ( MOUSE_SELECT | MOUSE_SIMPLECLICK ) ) && + else if ( ( rEvt.GetMode() & ( MouseEventModifiers::SELECT | MouseEventModifiers::SIMPLECLICK ) ) && ( bColumnCursor || rEvt.GetRow() >= 0 ) ) { if ( rEvt.GetClicks() == 1 ) @@ -1626,7 +1626,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) } // expanding mode? - if ( rEvt.GetMode() & MOUSE_RANGESELECT ) + if ( rEvt.GetMode() & MouseEventModifiers::RANGESELECT ) { // select the further touched rows too bSelect = true; @@ -1639,13 +1639,12 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) { // wait for Drag&Drop bHit = true; - bExtendedMode = MOUSE_MULTISELECT == - ( rEvt.GetMode() & MOUSE_MULTISELECT ); + bExtendedMode = bool( rEvt.GetMode() & MouseEventModifiers::MULTISELECT ); return; } // extension mode? - else if ( rEvt.GetMode() & MOUSE_MULTISELECT ) + else if ( rEvt.GetMode() & MouseEventModifiers::MULTISELECT ) { // determine the new selection range // and selection/deselection diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index f27af1cd60c5..027eb0353253 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -403,7 +403,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt ) Point aEventPos( rEvt.GetMousePosPixel() ); long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false); - MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT ); if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() && nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) ) { diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 154ead8e29cb..60e6fc2515db 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1307,7 +1307,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel ) { Point aEventPos( rPosPixel ); - MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT ); MouseButtonUp( aMouseEvt ); nOldDragMode = GetDragDropMode(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 2e8fa764f6b8..10fb75782778 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -897,7 +897,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) return; } - if ( (rMEvt.GetMode() & (MOUSE_MULTISELECT | MOUSE_RANGESELECT)) && (rMEvt.GetClicks() == 1) ) + if ( (rMEvt.GetMode() & (MouseEventModifiers::MULTISELECT | MouseEventModifiers::RANGESELECT)) && (rMEvt.GetClicks() == 1) ) { if ( nSelId ) { @@ -907,7 +907,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( pItem->mbEnable ) { - if ( (rMEvt.GetMode() & MOUSE_MULTISELECT) && (mnWinStyle & WB_MULTISELECT) ) + if ( (rMEvt.GetMode() & MouseEventModifiers::MULTISELECT) && (mnWinStyle & WB_MULTISELECT) ) { if ( nSelId != mnCurPageId ) { diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index f87d310a37e1..4d2ca798bf79 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -135,7 +135,7 @@ void SvxXConnectionPreview::AdaptSize() SetMapMode( aDisplayMap ); Point aPos; - MouseEvent aMEvt( aPos, 1, 0, MOUSE_RIGHT ); + MouseEvent aMEvt( aPos, 1, MouseEventModifiers::NONE, MOUSE_RIGHT ); MouseButtonDown( aMEvt ); } } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index c8a9dcf75a4a..f9514e7dec4a 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -3494,7 +3494,7 @@ void FmXGridCell::onWindowEvent( const sal_uIntPtr _nEventId, const vcl::Window& { awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) ); aEvent.ClickCount = 0; - const bool bSimpleMove = ( ( rMouseEvent.GetMode() & MOUSE_SIMPLEMOVE ) != 0 ); + const bool bSimpleMove = bool( rMouseEvent.GetMode() & MouseEventModifiers::SIMPLEMOVE ); m_aMouseMotionListeners.notifyEach( bSimpleMove ? &awt::XMouseMotionListener::mouseMoved: &awt::XMouseMotionListener::mouseDragged, aEvent ); } } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index bf7ca1cc4689..784d1e834339 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -63,7 +63,7 @@ SdrViewEvent::SdrViewEvent() eHdlKind(HDL_MOVE), eEndCreateCmd(SDRCREATE_NEXTPOINT), nMouseClicks(0), - nMouseMode(0), + nMouseMode(MouseEventModifiers::NONE), nMouseCode(0), nHlplIdx(0), nGlueId(0), diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index f7d7b419154b..8bdec5409e6d 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -682,7 +682,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) aWhere = Point( -1, -1 ); } - MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 ); + MouseEvent aMEvt( aWhere, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT, 0 ); awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) ); aEvent.PopupTrigger = sal_True; @@ -714,7 +714,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) ); aEvent.ClickCount = 0; // #92138# - if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE ) + if ( pMouseEvt->GetMode() & MouseEventModifiers::SIMPLEMOVE ) mpImpl->getMouseMotionListeners().mouseMoved( aEvent ); else mpImpl->getMouseMotionListeners().mouseDragged( aEvent ); diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 2b2082e75d59..431b512ee562 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -49,6 +49,7 @@ class ImplFontCache; class VCLXWindow; class SalFrame; class SalObject; +enum class MouseEventModifiers; namespace com { namespace sun { @@ -158,7 +159,7 @@ struct ImplFrameData sal_uInt16 mnClickCount; //< mouse click count sal_uInt16 mnFirstMouseCode; //< mouse code by mousebuttondown sal_uInt16 mnMouseCode; //< mouse code - sal_uInt16 mnMouseMode; //< mouse mode + MouseEventModifiers mnMouseMode; //< mouse mode MapUnit meMapUnit; //< last MapUnit for LogicUnitToPixel bool mbHasFocus; //< focus bool mbInMouseMove; //< is MouseMove on stack @@ -377,7 +378,7 @@ public: bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMouseLeave, long nX, long nY, sal_uIntPtr nMsgTime, - sal_uInt16 nCode, sal_uInt16 nMode ); + sal_uInt16 nCode, MouseEventModifiers nMode ); void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight ); #endif // INCLUDED_VCL_INC_WINDOW_H diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 1249ad4842c1..783312f78bf2 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -140,7 +140,7 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged ) long nX = mpWindowImpl->mpFrameData->mnLastMouseX; long nY = mpWindowImpl->mpFrameData->mnLastMouseY; sal_uInt16 nCode = nMouseCode; - sal_uInt16 nMode = mpWindowImpl->mpFrameData->mnMouseMode; + MouseEventModifiers nMode = mpWindowImpl->mpFrameData->mnMouseMode; bool bLeave; // check for MouseLeave if ( ((nX < 0) || (nY < 0) || @@ -150,9 +150,9 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged ) bLeave = true; else bLeave = false; - nMode |= MOUSE_SYNTHETIC; + nMode |= MouseEventModifiers::SYNTHETIC; if ( bModChanged ) - nMode |= MOUSE_MODIFIERCHANGED; + nMode |= MouseEventModifiers::MODIFIERCHANGED; ImplHandleMouseEvent( mpWindowImpl->mpFrameWindow, EVENT_MOUSEMOVE, bLeave, nX, nY, nTime, nCode, nMode ); } } diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx index 3fb692d16f71..d4a493c71449 100644 --- a/vcl/source/window/mouseevent.cxx +++ b/vcl/source/window/mouseevent.cxx @@ -26,7 +26,7 @@ /** inits this vcl KeyEvent with all settings from the given awt event **/ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ) : maPos( rEvent.X, rEvent.Y ) -, mnMode( 0 ) +, mnMode( MouseEventModifiers::NONE ) , mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) ) , mnCode( 0 ) { @@ -38,8 +38,8 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ) mnCode |= KEY_MOD1; if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 ) mnCode |= KEY_MOD2; - if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 ) - mnCode |= KEY_MOD3; + if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 ) + mnCode |= KEY_MOD3; } if( rEvent.Buttons ) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 4fc17254545b..90fe5799009f 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3535,7 +3535,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) { // pressing a modifier generates synthetic mouse moves // ignore it if keyboard selection is acive - if( HasFocus() && ( rMEvt.GetMode() & MOUSE_MODIFIERCHANGED ) ) + if( HasFocus() && ( rMEvt.GetMode() & MouseEventModifiers::MODIFIERCHANGED ) ) return; if ( ImplHandleMouseMove( rMEvt ) ) @@ -3625,7 +3625,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING ) { - if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE ) + if ( rMEvt.GetMode() & MouseEventModifiers::SIMPLEMOVE ) { sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() ); if ( nLinePtr & DOCK_LINEHSIZE ) @@ -4384,7 +4384,7 @@ void ToolBox::Command( const CommandEvent& rCEvt ) if ( mbCommandDrag ) { - MouseEvent aMEvt( aMousePos, 1, MOUSE_SIMPLECLICK, + MouseEvent aMEvt( aMousePos, 1, MouseEventModifiers::SIMPLEMOVE, MOUSE_LEFT, KEY_MOD2 ); ToolBox::MouseButtonDown( aMEvt ); return; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b4468848ef20..369124162a41 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1015,7 +1015,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p mpWindowImpl->mpFrameData->mnClickCount = 0; mpWindowImpl->mpFrameData->mnFirstMouseCode = 0; mpWindowImpl->mpFrameData->mnMouseCode = 0; - mpWindowImpl->mpFrameData->mnMouseMode = 0; + mpWindowImpl->mpFrameData->mnMouseMode = MouseEventModifiers::NONE; mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL; mpWindowImpl->mpFrameData->mbHasFocus = false; mpWindowImpl->mpFrameData->mbInMouseMove = false; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 5f6c8a66e32b..8fe7d9d88416 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -362,8 +362,9 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer ) pOutDev->ReMirror( aMousePos ); } MouseEvent aMEvt( ImplFrameToOutput( aMousePos ), - mpWindowImpl->mpFrameData->mnClickCount, 0, - mpWindowImpl->mpFrameData->mnMouseCode, mpWindowImpl->mpFrameData->mnMouseCode ); + mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE, + mpWindowImpl->mpFrameData->mnMouseCode, + mpWindowImpl->mpFrameData->mnMouseCode ); TrackingEvent aTEvt( aMEvt, TRACKING_REPEAT ); Tracking( aTEvt ); @@ -430,8 +431,9 @@ void Window::EndTracking( sal_uInt16 nFlags ) } MouseEvent aMEvt( ImplFrameToOutput( aMousePos ), - mpWindowImpl->mpFrameData->mnClickCount, 0, - mpWindowImpl->mpFrameData->mnMouseCode, mpWindowImpl->mpFrameData->mnMouseCode ); + mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE, + mpWindowImpl->mpFrameData->mnMouseCode, + mpWindowImpl->mpFrameData->mnMouseCode ); TrackingEvent aTEvt( aMEvt, nFlags | ENDTRACK_END ); Tracking( aTEvt ); } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index ee864f4de982..eba9491e28d7 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -269,7 +269,7 @@ static long ContextMenuEventLink( void* pCEvent, void* ) bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMouseLeave, long nX, long nY, sal_uLong nMsgTime, - sal_uInt16 nCode, sal_uInt16 nMode ) + sal_uInt16 nCode, MouseEventModifiers nMode ) { ImplSVData* pSVData = ImplGetSVData(); Point aMousePos( nX, nY ); @@ -309,7 +309,8 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous pWinFrameData->mnLastMouseX = nX; pWinFrameData->mnLastMouseY = nY; pWinFrameData->mnMouseCode = nCode; - pWinFrameData->mnMouseMode = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED); + MouseEventModifiers nTmpMask = MouseEventModifiers::SYNTHETIC | MouseEventModifiers::MODIFIERCHANGED; + pWinFrameData->mnMouseMode = nMode & ~nTmpMask; if ( bMouseLeave ) { pWinFrameData->mbMouseIn = false; @@ -388,7 +389,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous { ImplHandleMouseHelpRequest( pChild, aMousePos ); if( pWinFrameData->mpMouseMoveWin != pChild ) - nMode |= MOUSE_ENTERWINDOW; + nMode |= MouseEventModifiers::ENTERWINDOW; } // Call the hook also, if Window is disabled @@ -537,7 +538,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous if ( pMouseMoveWin ) { Point aLeaveMousePos = pMouseMoveWin->ImplFrameToOutput( aMousePos ); - MouseEvent aMLeaveEvt( aLeaveMousePos, nClicks, nMode | MOUSE_LEAVEWINDOW, nCode, nCode ); + MouseEvent aMLeaveEvt( aLeaveMousePos, nClicks, nMode | MouseEventModifiers::LEAVEWINDOW, nCode, nCode ); NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt ); ImplDelData aDelData; ImplDelData aDelData2; @@ -570,7 +571,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous pMouseMoveWin->ImplRemoveDel( &aDelData ); } - nMode |= MOUSE_ENTERWINDOW; + nMode |= MouseEventModifiers::ENTERWINDOW; } pWinFrameData->mpMouseMoveWin = pChild; if( pChild ) @@ -1925,31 +1926,31 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent ) } } -static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent ) +static MouseEventModifiers ImplGetMouseMoveMode( SalMouseEvent* pEvent ) { - sal_uInt16 nMode = 0; + MouseEventModifiers nMode = MouseEventModifiers::NONE; if ( !pEvent->mnCode ) - nMode |= MOUSE_SIMPLEMOVE; + nMode |= MouseEventModifiers::SIMPLEMOVE; if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) ) - nMode |= MOUSE_DRAGMOVE; + nMode |= MouseEventModifiers::DRAGMOVE; if ( (pEvent->mnCode & MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) ) - nMode |= MOUSE_DRAGCOPY; + nMode |= MouseEventModifiers::DRAGCOPY; return nMode; } -static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent ) +static MouseEventModifiers ImplGetMouseButtonMode( SalMouseEvent* pEvent ) { - sal_uInt16 nMode = 0; + MouseEventModifiers nMode = MouseEventModifiers::NONE; if ( pEvent->mnButton == MOUSE_LEFT ) - nMode |= MOUSE_SIMPLECLICK; + nMode |= MouseEventModifiers::SIMPLECLICK; if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) ) - nMode |= MOUSE_SELECT; + nMode |= MouseEventModifiers::SELECT; if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_SHIFT)) ) - nMode |= MOUSE_MULTISELECT; + nMode |= MouseEventModifiers::MULTISELECT; if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_SHIFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_MOD1)) ) - nMode |= MOUSE_RANGESELECT; + nMode |= MouseEventModifiers::RANGESELECT; return nMode; } -- cgit