diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-06 13:26:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-07 07:10:39 +0000 |
commit | 2d48f5fc0a4f7b5b8c9d3a4f4cc85d5f3a7e5053 (patch) | |
tree | c2e18df7dd44255e98c91f242194fd9bb66f3f3e /vcl | |
parent | ed80d28d9f019a1afa2edd66e115eae26ea19963 (diff) |
convert VCLEVENT constants to scoped enum
Change-Id: Ic8ccb0a9715ec05182dacddab2c015b0de6a0fba
Reviewed-on: https://gerrit.libreoffice.org/31675
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
35 files changed, 249 insertions, 249 deletions
diff --git a/vcl/osx/a11yfocustracker.cxx b/vcl/osx/a11yfocustracker.cxx index 1389ae3c18ea..5f2e1c94ad64 100644 --- a/vcl/osx/a11yfocustracker.cxx +++ b/vcl/osx/a11yfocustracker.cxx @@ -49,25 +49,25 @@ void AquaA11yFocusTracker::WindowEventHandler(void * pThis, VclSimpleEvent& rEve pThis); switch (rEvent.GetId()) { - case VCLEVENT_WINDOW_PAINT: + case VclEventId::WindowPaint: pFocusTracker-> toolbox_open_floater( getWindow(&rEvent) ); break; - case VCLEVENT_WINDOW_GETFOCUS: + case VclEventId::WindowGetFocus: pFocusTracker->window_got_focus( getWindow(&rEvent) ); break; - case VCLEVENT_OBJECT_DYING: + case VclEventId::ObjectDying: pFocusTracker->m_aDocumentWindowList.erase( getWindow(&rEvent) ); SAL_FALLTHROUGH; - case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: + case VclEventId::ToolboxHighlightOff: pFocusTracker->toolbox_highlight_off( getWindow(&rEvent) ); break; - case VCLEVENT_TOOLBOX_HIGHLIGHT: + case VclEventId::ToolboxHighlight: pFocusTracker->toolbox_highlight_on( getWindow(&rEvent) ); break; - case VCLEVENT_TABPAGE_ACTIVATE: + case VclEventId::TabpageActivate: pFocusTracker->tabpage_activated( getWindow(&rEvent) ); break; - case VCLEVENT_MENU_HIGHLIGHT: + case VclEventId::MenuHighlight: // Inspired by code in WindowEventHandler in // vcl/unx/gtk/a11y/atkutil.cxx, find out what kind of event // it is to avoid blindly using a static_cast and crash, @@ -209,11 +209,11 @@ void AquaA11yFocusTracker::menu_highlighted(const VclMenuEvent *pEvent) void AquaA11yFocusTracker::window_got_focus(vcl::Window *pWindow) { - // The menu bar is handled through VCLEVENT_MENU_HIGHLIGHTED + // The menu bar is handled through VclEventId::MenuHighlightED if( ! pWindow || !pWindow->IsReallyVisible() || pWindow->GetType() == WINDOW_MENUBARWINDOW ) return; - // ToolBoxes are handled through VCLEVENT_TOOLBOX_HIGHLIGHT + // ToolBoxes are handled through VclEventId::ToolboxHighlight if( pWindow->GetType() == WINDOW_TOOLBOX ) return; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 7b06b5dde778..e839815415f3 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -165,7 +165,7 @@ struct ImplEventHook struct ImplPostEventData { - sal_uLong mnEvent; + VclEventId mnEvent; VclPtr<vcl::Window> mpWin; ImplSVEvent * mnEventId; KeyEvent maKeyEvent; @@ -173,14 +173,14 @@ struct ImplPostEventData ZoomEvent maZoomEvent; ScrollEvent maScrollEvent; - ImplPostEventData( sal_uLong nEvent, vcl::Window* pWin, const KeyEvent& rKeyEvent ) : + ImplPostEventData( VclEventId nEvent, vcl::Window* pWin, const KeyEvent& rKeyEvent ) : mnEvent( nEvent ), mpWin( pWin ), mnEventId( nullptr ), maKeyEvent( rKeyEvent ) {} - ImplPostEventData( sal_uLong nEvent, vcl::Window* pWin, const MouseEvent& rMouseEvent ) : + ImplPostEventData( VclEventId nEvent, vcl::Window* pWin, const MouseEvent& rMouseEvent ) : mnEvent( nEvent ), mpWin( pWin ), mnEventId( nullptr ), maMouseEvent( rMouseEvent ) {} #if !HAVE_FEATURE_DESKTOP - ImplPostEventData( sal_uLong nEvent, vcl::Window* pWin, const ZoomEvent& rZoomEvent ) : + ImplPostEventData( VclEventId nEvent, vcl::Window* pWin, const ZoomEvent& rZoomEvent ) : mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maZoomEvent( rZoomEvent ) {} - ImplPostEventData( sal_uLong nEvent, vcl::Window* pWin, const ScrollEvent& rScrollEvent ) : + ImplPostEventData( VclEventId nEvent, vcl::Window* pWin, const ScrollEvent& rScrollEvent ) : mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maScrollEvent( rScrollEvent ) {} #endif @@ -394,8 +394,8 @@ namespace return false; KeyEvent aVCLKeyEvt(nCharCode, nCode); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, xWin.get(), &aVCLKeyEvt); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, xWin.get(), &aVCLKeyEvt); + Application::PostKeyEvent(VclEventId::WindowKeyInput, xWin.get(), &aVCLKeyEvt); + Application::PostKeyEvent(VclEventId::WindowKeyUp, xWin.get(), &aVCLKeyEvt); return true; } @@ -702,7 +702,7 @@ void Application::SetSettings( const AllSettings& rSettings ) DataChangedEvent aDCEvt( DataChangedEventType::SETTINGS, &aOldSettings, nChangeFlags ); // notify data change handler - ImplCallEventListeners( VCLEVENT_APPLICATION_DATACHANGED, nullptr, &aDCEvt); + ImplCallEventListeners( VclEventId::ApplicationDataChanged, nullptr, &aDCEvt); // Update all windows vcl::Window* pFirstFrame = pSVData->maWinData.mpFirstFrame; @@ -820,7 +820,7 @@ void Application::NotifyAllWindows( DataChangedEvent& rDCEvt ) } } -void Application::ImplCallEventListeners( sal_uLong nEvent, vcl::Window *pWin, void* pData ) +void Application::ImplCallEventListeners( VclEventId nEvent, vcl::Window *pWin, void* pData ) { ImplSVData* pSVData = ImplGetSVData(); VclWindowEvent aEvent( pWin, nEvent, pData ); @@ -870,7 +870,7 @@ void Application::RemoveKeyListener( const Link<VclWindowEvent&,bool>& rKeyListe } } -bool Application::HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) +bool Application::HandleKey( VclEventId nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) { // let listeners process the key event VclWindowEvent aEvent( pWin, nEvent, static_cast<void *>(pKeyEvent) ); @@ -897,7 +897,7 @@ bool Application::HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKey return bProcessed; } -ImplSVEvent * Application::PostKeyEvent( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) +ImplSVEvent * Application::PostKeyEvent( VclEventId nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) { const SolarMutexGuard aGuard; ImplSVEvent * nEventId = nullptr; @@ -922,7 +922,7 @@ ImplSVEvent * Application::PostKeyEvent( sal_uLong nEvent, vcl::Window *pWin, Ke return nEventId; } -ImplSVEvent * Application::PostMouseEvent( sal_uLong nEvent, vcl::Window *pWin, MouseEvent* pMouseEvent ) +ImplSVEvent * Application::PostMouseEvent( VclEventId nEvent, vcl::Window *pWin, MouseEvent* pMouseEvent ) { const SolarMutexGuard aGuard; ImplSVEvent * nEventId = nullptr; @@ -966,37 +966,37 @@ IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData, void ) switch( pData->mnEvent ) { - case VCLEVENT_WINDOW_MOUSEMOVE: + case VclEventId::WindowMouseMove: nEvent = SalEvent::ExternalMouseMove; pEventData = &pData->maMouseEvent; break; - case VCLEVENT_WINDOW_MOUSEBUTTONDOWN: + case VclEventId::WindowMouseButtonDown: nEvent = SalEvent::ExternalMouseButtonDown; pEventData = &pData->maMouseEvent; break; - case VCLEVENT_WINDOW_MOUSEBUTTONUP: + case VclEventId::WindowMouseButtonUp: nEvent = SalEvent::ExternalMouseButtonUp; pEventData = &pData->maMouseEvent; break; - case VCLEVENT_WINDOW_KEYINPUT: + case VclEventId::WindowKeyInput: nEvent = SalEvent::ExternalKeyInput; pEventData = &pData->maKeyEvent; break; - case VCLEVENT_WINDOW_KEYUP: + case VclEventId::WindowKeyUp: nEvent = SalEvent::ExternalKeyUp; pEventData = &pData->maKeyEvent; break; - case VCLEVENT_WINDOW_ZOOM: + case VclEventId::WindowZoom: nEvent = SalEvent::ExternalZoom; pEventData = &pData->maZoomEvent; break; - case VCLEVENT_WINDOW_SCROLL: + case VclEventId::WindowScroll: nEvent = SalEvent::ExternalScroll; pEventData = &pData->maScrollEvent; break; diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index a7ec9491a4bf..2cab94c4561e 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -30,7 +30,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::accessibility::XAccessible; -VclAccessibleEvent::VclAccessibleEvent( sal_uLong n, const Reference<XAccessible>& rxAccessible ) : +VclAccessibleEvent::VclAccessibleEvent( VclEventId n, const Reference<XAccessible>& rxAccessible ) : VclSimpleEvent(n), mxAccessible(rxAccessible) { @@ -84,14 +84,14 @@ void VclEventListeners::removeListener( const Link<VclSimpleEvent&,void>& rListe m_aListeners.erase( std::remove(m_aListeners.begin(), m_aListeners.end(), rListener ), m_aListeners.end() ); } -VclWindowEvent::VclWindowEvent( vcl::Window* pWin, sal_uLong n, void* pDat ) : VclSimpleEvent(n) +VclWindowEvent::VclWindowEvent( vcl::Window* pWin, VclEventId n, void* pDat ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; } VclWindowEvent::~VclWindowEvent() {} -VclMenuEvent::VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) +VclMenuEvent::VclMenuEvent( Menu* pM, VclEventId n, sal_uInt16 nPos ) : VclSimpleEvent(n), pMenu(pM), mnPos(nPos) {} diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index e331115d005e..6eceff68a954 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -124,7 +124,7 @@ void Button::SetCommandHandler(const OUString& aCommand) void Button::Click() { - ImplCallEventListenersAndHandler( VCLEVENT_BUTTON_CLICK, [this] () { maClickHdl.Call(this); } ); + ImplCallEventListenersAndHandler( VclEventId::ButtonClick, [this] () { maClickHdl.Call(this); } ); } OUString Button::GetStandardText( StandardButtonType eButton ) @@ -1554,7 +1554,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) void PushButton::Toggle() { - ImplCallEventListenersAndHandler( VCLEVENT_PUSHBUTTON_TOGGLE, nullptr ); + ImplCallEventListenersAndHandler( VclEventId::PushbuttonToggle, nullptr ); } void PushButton::SetSymbol( SymbolType eSymbol ) @@ -2620,7 +2620,7 @@ bool RadioButton::PreNotify( NotifyEvent& rNEvt ) void RadioButton::Toggle() { - ImplCallEventListenersAndHandler( VCLEVENT_RADIOBUTTON_TOGGLE, [this] () { maToggleHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::RadiobuttonToggle, [this] () { maToggleHdl.Call(*this); } ); } bool RadioButton::SetModeRadioImage( const Image& rImage ) @@ -3537,7 +3537,7 @@ bool CheckBox::PreNotify( NotifyEvent& rNEvt ) void CheckBox::Toggle() { - ImplCallEventListenersAndHandler( VCLEVENT_CHECKBOX_TOGGLE, [this] () { maToggleHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::CheckboxToggle, [this] () { maToggleHdl.Call(*this); } ); } void CheckBox::SetState( TriState eState ) diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 08a750e6ffc1..15b7344966bc 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -268,7 +268,7 @@ bool ComboBox::IsAutocompleteEnabled() const IMPL_LINK_NOARG(ComboBox::Impl, ImplClickBtnHdl, void*, void) { - m_rThis.CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + m_rThis.CallEventListeners( VclEventId::DropdownPreOpen ); m_pSubEdit->GrabFocus(); if (!m_pImplLB->GetEntryList()->GetMRUCount()) ImplUpdateFloatSelection(); @@ -277,7 +277,7 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplClickBtnHdl, void*, void) m_pBtn->SetPressed( true ); m_rThis.SetSelection( Selection( 0, SELECTION_MAX ) ); m_pFloatWin->StartFloat( true ); - m_rThis.CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + m_rThis.CallEventListeners( VclEventId::DropdownOpen ); m_rThis.ImplClearLayoutData(); if (m_pImplLB) @@ -304,7 +304,7 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplPopupModeEndHdl, FloatingWindow*, void) m_pImplLB->GetMainWindow()->ImplClearLayoutData(); m_pBtn->SetPressed( false ); - m_rThis.CallEventListeners( VCLEVENT_DROPDOWN_CLOSE ); + m_rThis.CallEventListeners( VclEventId::DropdownClose ); } IMPL_LINK(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) @@ -435,7 +435,7 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplSelectHdl, LinkParamNone*, void) IMPL_LINK_NOARG( ComboBox::Impl, ImplListItemSelectHdl, LinkParamNone*, void ) { - m_rThis.CallEventListeners( VCLEVENT_DROPDOWN_SELECT ); + m_rThis.CallEventListeners( VclEventId::DropdownSelect ); } IMPL_LINK_NOARG(ComboBox::Impl, ImplCancelHdl, LinkParamNone*, void) @@ -471,23 +471,23 @@ void ComboBox::ToggleDropDown() m_pImpl->ImplUpdateFloatSelection(); else m_pImpl->m_pImplLB->SelectEntry( 0 , true ); - CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + CallEventListeners( VclEventId::DropdownPreOpen ); m_pImpl->m_pBtn->SetPressed( true ); SetSelection( Selection( 0, SELECTION_MAX ) ); m_pImpl->m_pFloatWin->StartFloat( true ); - CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + CallEventListeners( VclEventId::DropdownOpen ); } } } void ComboBox::Select() { - ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_SELECT, [this] () { m_pImpl->m_SelectHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::ComboboxSelect, [this] () { m_pImpl->m_SelectHdl.Call(*this); } ); } void ComboBox::DoubleClick() { - ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_DOUBLECLICK, [this] () { m_pImpl->m_DoubleClickHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::ComboboxDoubleClick, [this] () { m_pImpl->m_DoubleClickHdl.Call(*this); } ); } bool ComboBox::IsAutoSizeEnabled() const { return m_pImpl->m_isDDAutoSize; } @@ -715,13 +715,13 @@ bool ComboBox::EventNotify( NotifyEvent& rNEvt ) && !m_pImpl->m_pFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2()) { - CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + CallEventListeners( VclEventId::DropdownPreOpen ); m_pImpl->m_pBtn->SetPressed( true ); if (m_pImpl->m_pImplLB->GetEntryList()->GetMRUCount()) m_pImpl->m_pImplLB->SelectEntry( 0 , true ); SetSelection( Selection( 0, SELECTION_MAX ) ); m_pImpl->m_pFloatWin->StartFloat( false ); - CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + CallEventListeners( VclEventId::DropdownOpen ); bDone = true; } else if ((nKeyCode == KEY_UP) && m_pImpl->m_pFloatWin @@ -785,7 +785,7 @@ bool ComboBox::EventNotify( NotifyEvent& rNEvt ) void ComboBox::SetText( const OUString& rStr ) { - CallEventListeners( VCLEVENT_COMBOBOX_SETTEXT ); + CallEventListeners( VclEventId::ComboboxSetText ); Edit::SetText( rStr ); m_pImpl->ImplUpdateFloatSelection(); @@ -793,7 +793,7 @@ void ComboBox::SetText( const OUString& rStr ) void ComboBox::SetText( const OUString& rStr, const Selection& rNewSelection ) { - CallEventListeners( VCLEVENT_COMBOBOX_SETTEXT ); + CallEventListeners( VclEventId::ComboboxSetText ); Edit::SetText( rStr, rNewSelection ); m_pImpl->ImplUpdateFloatSelection(); @@ -876,7 +876,7 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos) nRealPos = m_pImpl->m_pImplLB->InsertEntry( nRealPos, rStr ); nRealPos -= m_pImpl->m_pImplLB->GetEntryList()->GetMRUCount(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -897,7 +897,7 @@ sal_Int32 ComboBox::InsertEntryWithImage( nRealPos = m_pImpl->m_pImplLB->InsertEntry( nRealPos, rStr, rImage ); nRealPos -= m_pImpl->m_pImplLB->GetEntryList()->GetMRUCount(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -913,13 +913,13 @@ void ComboBox::RemoveEntryAt(sal_Int32 const nPos) return; m_pImpl->m_pImplLB->RemoveEntry( nPos + nMRUCount ); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(nPos) ); } void ComboBox::Clear() { m_pImpl->m_pImplLB->Clear(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, reinterpret_cast<void*>(-1) ); + CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(-1) ); } Image ComboBox::GetEntryImage( sal_Int32 nPos ) const diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index a5fd5bc021d3..9016b8661f2e 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -236,7 +236,7 @@ bool Control::EventNotify( NotifyEvent& rNEvt ) { mbHasControlFocus = true; CompatStateChanged( StateChangedType::ControlFocus ); - if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, [this] () { maGetFocusHdl.Call(*this); } ) ) + if ( ImplCallEventListenersAndHandler( VclEventId::ControlGetFocus, [this] () { maGetFocusHdl.Call(*this); } ) ) // been destroyed within the handler return true; } @@ -250,7 +250,7 @@ bool Control::EventNotify( NotifyEvent& rNEvt ) { mbHasControlFocus = false; CompatStateChanged( StateChangedType::ControlFocus ); - if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, [this] () { maLoseFocusHdl.Call(*this); } ) ) + if ( ImplCallEventListenersAndHandler( VclEventId::ControlLoseFocus, [this] () { maLoseFocusHdl.Call(*this); } ) ) // been destroyed within the handler return true; } @@ -298,7 +298,7 @@ void Control::AppendLayoutData( const Control& rSubControl ) const } } -bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, std::function<void()> const & callHandler ) +bool Control::ImplCallEventListenersAndHandler( VclEventId nEvent, std::function<void()> const & callHandler ) { VclPtr<Control> xThis(this); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 1542d5bd428b..f33c785fb653 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -933,7 +933,7 @@ void Edit::ImplSetText( const OUString& rText, const Selection* pNewSelection ) else ImplInsertText( rText, pNewSelection ); - CallEventListeners( VCLEVENT_EDIT_MODIFY ); + CallEventListeners( VclEventId::EditModify ); } } @@ -1865,9 +1865,9 @@ void Edit::GetFocus() maSelection.Max() = maText.getLength(); } if ( mbIsSubEdit ) - static_cast<Edit*>(GetParent())->CallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + static_cast<Edit*>(GetParent())->CallEventListeners( VclEventId::EditSelectionChanged ); else - CallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + CallEventListeners( VclEventId::EditSelectionChanged ); } ImplShowCursor(); @@ -2345,12 +2345,12 @@ void Edit::Modify() if ( mpUpdateDataTimer ) mpUpdateDataTimer->Start(); - if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, [this] () { maModifyHdl.Call(*this); } ) ) + if ( ImplCallEventListenersAndHandler( VclEventId::EditModify, [this] () { maModifyHdl.Call(*this); } ) ) // have been destroyed while calling into the handlers return; // #i13677# notify edit listeners about caret position change - CallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + CallEventListeners( VclEventId::EditCaretChanged ); // FIXME: this is currently only on OS X // check for other platforms that need similar handling if( ImplGetSVData()->maNWFData.mbNoFocusRects && @@ -2499,22 +2499,22 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint ) if (bSelection) { if ( mbIsSubEdit ) - static_cast<Edit*>(GetParent())->CallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + static_cast<Edit*>(GetParent())->CallEventListeners( VclEventId::EditSelectionChanged ); else - CallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + CallEventListeners( VclEventId::EditSelectionChanged ); } if (bCaret) { if ( mbIsSubEdit ) - static_cast<Edit*>(GetParent())->CallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + static_cast<Edit*>(GetParent())->CallEventListeners( VclEventId::EditCaretChanged ); else - CallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + CallEventListeners( VclEventId::EditCaretChanged ); } // #103511# notify combobox listeners of deselection if( !maSelection && GetParent() && GetParent()->GetType() == WINDOW_COMBOBOX ) - static_cast<Edit*>(GetParent())->CallEventListeners( VCLEVENT_COMBOBOX_DESELECT ); + static_cast<Edit*>(GetParent())->CallEventListeners( VclEventId::ComboboxDeselect ); } } } diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx index 8cfff9620358..6843485e14f1 100644 --- a/vcl/source/control/fixedhyper.cxx +++ b/vcl/source/control/fixedhyper.cxx @@ -90,7 +90,7 @@ void FixedHyperlink::MouseButtonUp( const MouseEvent& ) { // calls the link if the control is enabled and the mouse is over the text. if ( IsEnabled() && ImplIsOverText(GetPointerPosPixel()) ) - ImplCallEventListenersAndHandler( VCLEVENT_BUTTON_CLICK, [this] () { m_aClickHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::ButtonClick, [this] () { m_aClickHdl.Call(*this); } ); } void FixedHyperlink::RequestHelp( const HelpEvent& rHEvt ) diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index af9309d9612d..a09bdb98c9e8 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -921,7 +921,7 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) mbTravelSelect = false; } // When list box selection change by mouse move, notify - // VCLEVENT_LISTBOX_SELECT vcl event. + // VclEventId::ListboxSelect vcl event. else { maListItemSelectHdl.Call(nullptr); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index d8f882bbf94a..3d523d0ac747 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -63,7 +63,7 @@ ListBox::~ListBox() void ListBox::dispose() { - CallEventListeners( VCLEVENT_OBJECT_DYING ); + CallEventListeners( VclEventId::ObjectDying ); mpImplLB.disposeAndClear(); mpFloatWin.disposeAndClear(); @@ -203,17 +203,17 @@ IMPL_LINK_NOARG(ListBox, ImplSelectHdl, LinkParamNone*, void) IMPL_LINK( ListBox, ImplFocusHdl, sal_Int32, nPos, void ) { - CallEventListeners( VCLEVENT_LISTBOX_FOCUS, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos) ); } IMPL_LINK_NOARG( ListBox, ImplListItemSelectHdl, LinkParamNone*, void ) { - CallEventListeners( VCLEVENT_DROPDOWN_SELECT ); + CallEventListeners( VclEventId::DropdownSelect ); } IMPL_LINK_NOARG(ListBox, ImplScrollHdl, ImplListBox*, void) { - CallEventListeners( VCLEVENT_LISTBOX_SCROLLED ); + CallEventListeners( VclEventId::ListboxScrolled ); } IMPL_LINK_NOARG(ListBox, ImplCancelHdl, LinkParamNone*, void) @@ -260,11 +260,11 @@ IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl, void*, void) { if( !mpFloatWin->IsInPopupMode() ) { - CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + CallEventListeners( VclEventId::DropdownPreOpen ); mpImplWin->GrabFocus(); mpBtn->SetPressed( true ); mpFloatWin->StartFloat( true ); - CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + CallEventListeners( VclEventId::DropdownOpen ); ImplClearLayoutData(); if( mpImplLB ) @@ -301,7 +301,7 @@ IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl, FloatingWindow*, void) mpImplWin->ImplClearLayoutData(); mpBtn->SetPressed( false ); - CallEventListeners( VCLEVENT_DROPDOWN_CLOSE ); + CallEventListeners( VclEventId::DropdownClose ); } void ListBox::ToggleDropDown() @@ -312,11 +312,11 @@ void ListBox::ToggleDropDown() mpFloatWin->EndPopupMode(); else { - CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + CallEventListeners( VclEventId::DropdownPreOpen ); mpImplWin->GrabFocus(); mpBtn->SetPressed( true ); mpFloatWin->StartFloat( true ); - CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + CallEventListeners( VclEventId::DropdownOpen ); } } } @@ -840,10 +840,10 @@ bool ListBox::PreNotify( NotifyEvent& rNEvt ) if( mpFloatWin && !mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() ) { - CallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); + CallEventListeners( VclEventId::DropdownPreOpen ); mpBtn->SetPressed( true ); mpFloatWin->StartFloat( false ); - CallEventListeners( VCLEVENT_DROPDOWN_OPEN ); + CallEventListeners( VclEventId::DropdownOpen ); bDone = true; } else @@ -912,12 +912,12 @@ bool ListBox::PreNotify( NotifyEvent& rNEvt ) void ListBox::Select() { - ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_SELECT, [this] () { maSelectHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::ListboxSelect, [this] () { maSelectHdl.Call(*this); } ); } void ListBox::DoubleClick() { - ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_DOUBLECLICK, [this] () { maDoubleClickHdl.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::ListboxDoubleClick, [this] () { maDoubleClickHdl.Call(*this); } ); } void ListBox::Clear() @@ -933,7 +933,7 @@ void ListBox::Clear() mpImplWin->SetImage( aImage ); mpImplWin->Invalidate(); } - CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, reinterpret_cast<void*>(-1) ); + CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(-1) ); } void ListBox::SetNoSelection() @@ -947,14 +947,14 @@ void ListBox::SetNoSelection() mpImplWin->SetImage( aImage ); mpImplWin->Invalidate(); } - CallEventListeners(VCLEVENT_LISTBOX_STATEUPDATE); + CallEventListeners(VclEventId::ListboxStateUpdate); } sal_Int32 ListBox::InsertEntry( const OUString& rStr, sal_Int32 nPos ) { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount()); - CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -962,7 +962,7 @@ sal_Int32 ListBox::InsertEntry( const OUString& rStr, const Image& rImage, sal_I { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount()); - CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -974,7 +974,7 @@ void ListBox::RemoveEntry( const OUString& rStr ) void ListBox::RemoveEntry( sal_Int32 nPos ) { mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); - CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(nPos) ); } Image ListBox::GetEntryImage( sal_Int32 nPos ) const @@ -1071,13 +1071,13 @@ void ListBox::SelectEntryPos( sal_Int32 nPos, bool bSelect ) mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect ); newSelectCount = GetSelectEntryCount(); if (oldSelectCount == 0 && newSelectCount > 0) - CallEventListeners(VCLEVENT_LISTBOX_STATEUPDATE); + CallEventListeners(VclEventId::ListboxStateUpdate); //Only when bSelect == true, send both Selection & Focus events if (nCurrentPos != nPos && bSelect) { - CallEventListeners( VCLEVENT_LISTBOX_SELECT, reinterpret_cast<void*>(nPos)); + CallEventListeners( VclEventId::ListboxSelect, reinterpret_cast<void*>(nPos)); if (HasFocus()) - CallEventListeners( VCLEVENT_LISTBOX_FOCUS, reinterpret_cast<void*>(nPos)); + CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos)); } } } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index c16f4f52de57..5ddc7dc25e4e 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -1310,12 +1310,12 @@ bool ScrollBar::PreNotify( NotifyEvent& rNEvt ) void ScrollBar::Scroll() { - ImplCallEventListenersAndHandler( VCLEVENT_SCROLLBAR_SCROLL, [this] () { maScrollHdl.Call(this); } ); + ImplCallEventListenersAndHandler( VclEventId::ScrollbarScroll, [this] () { maScrollHdl.Call(this); } ); } void ScrollBar::EndScroll() { - ImplCallEventListenersAndHandler( VCLEVENT_SCROLLBAR_ENDSCROLL, [this] () { maEndScrollHdl.Call(this); } ); + ImplCallEventListenersAndHandler( VclEventId::ScrollbarEndScroll, [this] () { maEndScrollHdl.Call(this); } ); } long ScrollBar::DoScroll( long nNewPos ) diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 4c1a7085eb2b..029c313219a8 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -82,7 +82,7 @@ void SpinButton::Up() ImplMoveFocus(true); } - ImplCallEventListenersAndHandler(VCLEVENT_SPINBUTTON_UP, nullptr ); + ImplCallEventListenersAndHandler(VclEventId::SpinbuttonUp, nullptr ); } void SpinButton::Down() @@ -95,7 +95,7 @@ void SpinButton::Down() ImplMoveFocus(false); } - ImplCallEventListenersAndHandler(VCLEVENT_SPINBUTTON_DOWN, nullptr ); + ImplCallEventListenersAndHandler(VclEventId::SpinbuttonDown, nullptr ); } void SpinButton::Resize() diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index ad36af9932ee..169b6c30e054 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -359,22 +359,22 @@ void SpinField::dispose() void SpinField::Up() { - ImplCallEventListenersAndHandler( VCLEVENT_SPINFIELD_UP, [this] () { maUpHdlLink.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::SpinfieldUp, [this] () { maUpHdlLink.Call(*this); } ); } void SpinField::Down() { - ImplCallEventListenersAndHandler( VCLEVENT_SPINFIELD_DOWN, [this] () { maDownHdlLink.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::SpinfieldDown, [this] () { maDownHdlLink.Call(*this); } ); } void SpinField::First() { - ImplCallEventListenersAndHandler( VCLEVENT_SPINFIELD_FIRST, [this] () { maFirstHdlLink.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::SpinfieldFirst, [this] () { maFirstHdlLink.Call(*this); } ); } void SpinField::Last() { - ImplCallEventListenersAndHandler( VCLEVENT_SPINFIELD_LAST, [this] () { maLastHdlLink.Call(*this); } ); + ImplCallEventListenersAndHandler( VclEventId::SpinfieldLast, [this] () { maLastHdlLink.Call(*this); } ); } void SpinField::MouseButtonDown( const MouseEvent& rMEvt ) diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index f570721551c8..0dc66120df89 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -997,7 +997,7 @@ IMPL_LINK_NOARG(TabControl, ImplListBoxSelectHdl, ListBox&, void) IMPL_LINK( TabControl, ImplWindowEventListener, VclWindowEvent&, rEvent, void ) { - if ( rEvent.GetId() == VCLEVENT_WINDOW_KEYINPUT ) + if ( rEvent.GetId() == VclEventId::WindowKeyInput ) { // Do not handle events from TabControl or its children, which is done in Notify(), where the events can be consumed. if ( !IsWindowOrChild( rEvent.GetWindow() ) ) @@ -1674,7 +1674,7 @@ void TabControl::InsertPage( sal_uInt16 nPageId, const OUString& rText, if( mpTabCtrlData->mpListBox ) // reposition/resize listbox Resize(); - CallEventListeners( VCLEVENT_TABPAGE_INSERTED, reinterpret_cast<void*>(nPageId) ); + CallEventListeners( VclEventId::TabpageInserted, reinterpret_cast<void*>(nPageId) ); } void TabControl::RemovePage( sal_uInt16 nPageId ) @@ -1719,7 +1719,7 @@ void TabControl::RemovePage( sal_uInt16 nPageId ) ImplFreeLayoutData(); - CallEventListeners( VCLEVENT_TABPAGE_REMOVED, reinterpret_cast<void*>(nPageId) ); + CallEventListeners( VclEventId::TabpageRemoved, reinterpret_cast<void*>(nPageId) ); } } @@ -1737,7 +1737,7 @@ void TabControl::Clear() if ( IsUpdateMode() ) Invalidate(); - CallEventListeners( VCLEVENT_TABPAGE_REMOVEDALL ); + CallEventListeners( VclEventId::TabpageRemovedAll ); } void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable ) @@ -1869,7 +1869,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId ) { ImplFreeLayoutData(); - CallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, reinterpret_cast<void*>(mnCurPageId) ); + CallEventListeners( VclEventId::TabpageDeactivate, reinterpret_cast<void*>(mnCurPageId) ); if ( DeactivatePage() ) { mnActPageId = nPageId; @@ -1880,7 +1880,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId ) SetCurPageId( nPageId ); if( mpTabCtrlData->mpListBox ) mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) ); - CallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, reinterpret_cast<void*>(nPageId) ); + CallEventListeners( VclEventId::TabpageActivate, reinterpret_cast<void*>(nPageId) ); } } } @@ -1940,7 +1940,7 @@ void TabControl::SetPageText( sal_uInt16 nPageId, const OUString& rText ) if ( IsUpdateMode() ) Invalidate(); ImplFreeLayoutData(); - CallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, reinterpret_cast<void*>(nPageId) ); + CallEventListeners( VclEventId::TabpagePageTextChanged, reinterpret_cast<void*>(nPageId) ); } } diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 1b38fc55d8ce..5004862dd0cd 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1070,7 +1070,7 @@ void VclMultiLineEdit::Modify() { aModifyHdlLink.Call( *this ); - CallEventListeners( VCLEVENT_EDIT_MODIFY ); + CallEventListeners( VclEventId::EditModify ); if ( pUpdateDataTimer ) pUpdateDataTimer->Start(); @@ -1078,12 +1078,12 @@ void VclMultiLineEdit::Modify() void VclMultiLineEdit::SelectionChanged() { - CallEventListeners(VCLEVENT_EDIT_SELECTIONCHANGED); + CallEventListeners(VclEventId::EditSelectionChanged); } void VclMultiLineEdit::CaretChanged() { - CallEventListeners(VCLEVENT_EDIT_CARETCHANGED); + CallEventListeners(VclEventId::EditCaretChanged); } IMPL_LINK_NOARG(VclMultiLineEdit, ImpUpdateDataHdl, Timer *, void) diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index ab2ac82bee85..0d0b21b60d8e 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -439,7 +439,7 @@ void Window::SetAccessibleName( const OUString& rName ) delete mpWindowImpl->mpAccessibleInfos->pAccessibleName; mpWindowImpl->mpAccessibleInfos->pAccessibleName = new OUString( rName ); - CallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldName ); + CallEventListeners( VclEventId::WindowFrameTitleChanged, &oldName ); } OUString Window::GetAccessibleName() const diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 688cfb5116e5..1b789020c6ed 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -719,7 +719,7 @@ void Dialog::DataChanged( const DataChangedEvent& rDCEvt ) bool Dialog::Close() { VclPtr<vcl::Window> xWindow = this; - CallEventListeners( VCLEVENT_WINDOW_CLOSE ); + CallEventListeners( VclEventId::WindowClose ); if ( xWindow->IsDisposed() ) return false; diff --git a/vcl/source/window/dndeventdispatcher.cxx b/vcl/source/window/dndeventdispatcher.cxx index c9c5aa607463..e02d8fc0e8fd 100644 --- a/vcl/source/window/dndeventdispatcher.cxx +++ b/vcl/source/window/dndeventdispatcher.cxx @@ -70,7 +70,7 @@ vcl::Window* DNDEventDispatcher::findTopLevelWindow(Point location) IMPL_LINK(DNDEventDispatcher, WindowEventListener, VclWindowEvent&, rEvent, void) { - if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) + if (rEvent.GetId() == VclEventId::ObjectDying) { designate_currentwindow(nullptr); } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 1467df89f029..7f32e74a9a8d 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -918,7 +918,7 @@ void ImplDockingWindowWrapper::StartDocking( const Point& rPoint, Rectangle& rRe { DockingData data( rPoint, rRect, IsFloatingMode() ); - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_STARTDOCKING, &data ); + GetWindow()->CallEventListeners( VclEventId::WindowStartDocking, &data ); mbDocking = true; } @@ -926,7 +926,7 @@ bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect ) { DockingData data( rPoint, rRect, IsFloatingMode() ); - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_DOCKING, &data ); + GetWindow()->CallEventListeners( VclEventId::WindowDocking, &data ); rRect = data.maTrackRect; return data.mbFloating; } @@ -966,7 +966,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo } EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() ); - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_ENDDOCKING, &data ); + GetWindow()->CallEventListeners( VclEventId::WindowEndDocking, &data ); mbDocking = false; @@ -979,7 +979,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo bool ImplDockingWindowWrapper::PrepareToggleFloatingMode() { bool bFloating = true; - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_PREPARETOGGLEFLOATING, &bFloating ); + GetWindow()->CallEventListeners( VclEventId::WindowPrepareToggleFloating, &bFloating ); return bFloating; } @@ -992,7 +992,7 @@ void ImplDockingWindowWrapper::ToggleFloatingMode() static_cast<DockingWindow*>(GetWindow())->ToggleFloatingMode(); // now notify listeners - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_TOGGLEFLOATING ); + GetWindow()->CallEventListeners( VclEventId::WindowToggleFloating ); // must be enabled in Window::Notify to prevent permanent docking during mouse move mbStartDockingEnabled = false; @@ -1128,7 +1128,7 @@ IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void) mpFloatWin.disposeAndClear(); // call handler - which will destroy the window and thus the wrapper as well ! - GetWindow()->CallEventListeners( VCLEVENT_WINDOW_ENDPOPUPMODE, &aData ); + GetWindow()->CallEventListeners( VclEventId::WindowEndPopupMode, &aData ); } bool ImplDockingWindowWrapper::IsInPopupMode() const diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index fe8492850299..67c67c0a7a3d 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -626,7 +626,7 @@ bool DockingWindow::PrepareToggleFloatingMode() bool DockingWindow::Close() { VclPtr<vcl::Window> xWindow = this; - CallEventListeners( VCLEVENT_WINDOW_CLOSE ); + CallEventListeners( VclEventId::WindowClose ); if ( xWindow->IsDisposed() ) return false; diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index 54997dda317d..e8bb662355ed 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -68,7 +68,7 @@ bool Window::PreNotify( NotifyEvent& rNEvt ) } if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_GETFOCUS ); + CallEventListeners( VclEventId::WindowGetFocus ); } else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS ) { @@ -80,7 +80,7 @@ bool Window::PreNotify( NotifyEvent& rNEvt ) } if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_LOSEFOCUS ); + CallEventListeners( VclEventId::WindowLoseFocus ); } // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )! @@ -203,7 +203,7 @@ bool Window::EventNotify( NotifyEvent& rNEvt ) return bRet; } -void Window::CallEventListeners( sal_uLong nEvent, void* pData ) +void Window::CallEventListeners( VclEventId nEvent, void* pData ) { VclWindowEvent aEvent( this, nEvent, pData ); @@ -400,7 +400,7 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() ); } - CallEventListeners( VCLEVENT_WINDOW_COMMAND, &aCommandEvent ); + CallEventListeners( VclEventId::WindowCommand, &aCommandEvent ); } } } @@ -417,11 +417,11 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); + CallEventListeners( VclEventId::WindowMouseMove, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); - CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, &aMouseEvent ); + CallEventListeners( VclEventId::WindowMouseMove, &aMouseEvent ); } } } @@ -430,11 +430,11 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); + CallEventListeners( VclEventId::WindowMouseButtonUp, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, &aMouseEvent ); + CallEventListeners( VclEventId::WindowMouseButtonUp, &aMouseEvent ); } } } @@ -443,23 +443,23 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); + CallEventListeners( VclEventId::WindowMouseButtonDown, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, &aMouseEvent ); + CallEventListeners( VclEventId::WindowMouseButtonDown, &aMouseEvent ); } } } else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) { if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_KEYINPUT, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); + CallEventListeners( VclEventId::WindowKeyInput, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); } else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP ) { if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_KEYUP, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); + CallEventListeners( VclEventId::WindowKeyUp, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); } if ( xWindow->IsDisposed() ) @@ -524,7 +524,7 @@ void Window::ImplCallResize() // #88419# Most classes don't call the base class in Resize() and Move(), // => Call ImpleResize/Move instead of Resize/Move directly... - CallEventListeners( VCLEVENT_WINDOW_RESIZE ); + CallEventListeners( VclEventId::WindowResize ); } void Window::ImplCallMove() @@ -566,7 +566,7 @@ void Window::ImplCallMove() Move(); - CallEventListeners( VCLEVENT_WINDOW_MOVE ); + CallEventListeners( VclEventId::WindowMove ); } void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index a0e0002c57be..0f42dd69887e 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1544,7 +1544,7 @@ void VclFrame::setAllocation(const Size &rAllocation) IMPL_LINK(VclFrame, WindowEventListener, VclWindowEvent&, rEvent, void) { - if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) + if (rEvent.GetId() == VclEventId::ObjectDying) designate_label(nullptr); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 0727b30c1e5f..00b931e32ba9 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -141,7 +141,7 @@ Menu::~Menu() void Menu::dispose() { - ImplCallEventListeners( VCLEVENT_OBJECT_DYING, ITEMPOS_INVALID ); + ImplCallEventListeners( VclEventId::ObjectDying, ITEMPOS_INVALID ); // at the window free the reference to the accessible component // and make sure the MenuFloatingWindow knows about our destruction @@ -210,7 +210,7 @@ void Menu::Activate() ImplMenuDelData aDelData( this ); - ImplCallEventListeners( VCLEVENT_MENU_ACTIVATE, ITEMPOS_INVALID ); + ImplCallEventListeners( VclEventId::MenuActivate, ITEMPOS_INVALID ); if( !aDelData.isDeleted() ) { @@ -251,7 +251,7 @@ void Menu::Deactivate() ImplMenuDelData aDelData( this ); Menu* pStartMenu = ImplGetStartMenu(); - ImplCallEventListeners( VCLEVENT_MENU_DEACTIVATE, ITEMPOS_INVALID ); + ImplCallEventListeners( VclEventId::MenuDeactivate, ITEMPOS_INVALID ); if( !aDelData.isDeleted() ) { @@ -300,7 +300,7 @@ void Menu::Select() { ImplMenuDelData aDelData( this ); - ImplCallEventListeners( VCLEVENT_MENU_SELECT, GetItemPos( GetCurItemId() ) ); + ImplCallEventListeners( VclEventId::MenuSelect, GetItemPos( GetCurItemId() ) ); if ( !aDelData.isDeleted() && !aSelectHdl.Call( this ) ) { if( !aDelData.isDeleted() ) @@ -328,14 +328,14 @@ void Menu::ImplSelectWithStart( Menu* pSMenu ) } #endif -void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos ) +void Menu::ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos ) { ImplMenuDelData aDelData( this ); VclMenuEvent aEvent( this, nEvent, nPos ); // This is needed by atk accessibility bridge - if ( nEvent == VCLEVENT_MENU_HIGHLIGHT ) + if ( nEvent == VclEventId::MenuHighlight ) { Application::ImplCallEventListeners( aEvent ); } @@ -404,7 +404,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nIt if ( pWin->IsVisible() ) pWin->Invalidate(); } - ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); + ImplCallEventListeners( VclEventId::MenuInsertItem, nPos ); } void Menu::InsertItem(sal_uInt16 nItemId, const Image& rImage, @@ -546,7 +546,7 @@ void Menu::InsertSeparator(const OString &rIdent, sal_uInt16 nPos) delete mpLayoutData; mpLayoutData = nullptr; - ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); + ImplCallEventListeners( VclEventId::MenuInsertItem, nPos ); } void Menu::RemoveItem( sal_uInt16 nPos ) @@ -574,7 +574,7 @@ void Menu::RemoveItem( sal_uInt16 nPos ) mpLayoutData = nullptr; if ( bRemove ) - ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos ); + ImplCallEventListeners( VclEventId::MenuRemoveItem, nPos ); } void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) @@ -804,7 +804,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) oldSubMenu.disposeAndClear(); - ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos ); + ImplCallEventListeners( VclEventId::MenuSubmenuChanged, nPos ); } PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const @@ -932,7 +932,7 @@ void Menu::CheckItem( sal_uInt16 nItemId, bool bCheck ) if( ImplGetSalMenu() ) ImplGetSalMenu()->CheckItem( nPos, bCheck ); - ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos ); + ImplCallEventListeners( bCheck ? VclEventId::MenuItemChecked : VclEventId::MenuItemUnchecked, nPos ); } bool Menu::IsItemChecked( sal_uInt16 nItemId ) const @@ -976,7 +976,7 @@ void Menu::EnableItem( sal_uInt16 nItemId, bool bEnable ) if( ImplGetSalMenu() ) ImplGetSalMenu()->EnableItem( nPos, bEnable ); - ImplCallEventListeners( bEnable ? VCLEVENT_MENU_ENABLE : VCLEVENT_MENU_DISABLE, nPos ); + ImplCallEventListeners( bEnable ? VclEventId::MenuEnable : VclEventId::MenuDisable, nPos ); } } @@ -1039,7 +1039,7 @@ void Menu::SetItemText( sal_uInt16 nItemId, const OUString& rStr ) pWin->Invalidate(); } - ImplCallEventListeners( VCLEVENT_MENU_ITEMTEXTCHANGED, nPos ); + ImplCallEventListeners( VclEventId::MenuItemTextChanged, nPos ); } } @@ -2137,7 +2137,7 @@ void Menu::ImplCallHighlight(sal_uInt16 nItem) MenuItemData* pData = pItemList->GetDataFromPos(nItem); if ( pData ) nSelectedId = pData->nId; - ImplCallEventListeners( VCLEVENT_MENU_HIGHLIGHT, GetItemPos( GetCurItemId() ) ); + ImplCallEventListeners( VclEventId::MenuHighlight, GetItemPos( GetCurItemId() ) ); if( !aDelData.isDeleted() ) nSelectedId = 0; @@ -2635,7 +2635,7 @@ bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventI ImplMenuDelData aDelData( pMenu ); if( mnHighlightedItemPos != ITEMPOS_INVALID ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, mnHighlightedItemPos ); + pMenu->ImplCallEventListeners( VclEventId::MenuDehighlight, mnHighlightedItemPos ); if( !aDelData.isDeleted() ) { @@ -2949,7 +2949,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl { pData->bIsTemporary = true; } - ImplCallEventListeners(VCLEVENT_MENU_SUBMENUCHANGED, nPos); + ImplCallEventListeners(VclEventId::MenuSubmenuChanged, nPos); } } else if (!(nMenuFlags & MenuFlags::NoAutoMnemonics)) @@ -3037,7 +3037,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl aPos = static_cast<MenuFloatingWindow *>(pSFrom->pWindow.get())->GetHighlightedItem(); pWin->SetPosInParent( aPos ); // store position to be sent in SUBMENUDEACTIVATE - pSFrom->ImplCallEventListeners( VCLEVENT_MENU_SUBMENUACTIVATE, aPos ); + pSFrom->ImplCallEventListeners( VclEventId::MenuSubmenuActivate, aPos ); } } if ( bPreSelectFirst ) diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index f412db46a7cd..f92290104608 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -255,11 +255,11 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent&, rEvent, void ) MenuBar::MenuBarButtonCallbackArg aArg; aArg.nId = 0xffff; - aArg.bHighlight = (rEvent.GetId() == VCLEVENT_TOOLBOX_HIGHLIGHT); + aArg.bHighlight = (rEvent.GetId() == VclEventId::ToolboxHighlight); aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu.get()); - if( rEvent.GetId() == VCLEVENT_TOOLBOX_HIGHLIGHT ) + if( rEvent.GetId() == VclEventId::ToolboxHighlight ) aArg.nId = aCloseBtn->GetHighlightItemId(); - else if( rEvent.GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF ) + else if( rEvent.GetId() == VclEventId::ToolboxHighlightOff ) { sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(rEvent.GetData())); aArg.nId = aCloseBtn->GetItemId(nPos); @@ -276,10 +276,10 @@ IMPL_LINK( MenuBarWindow, ShowHideListener, VclWindowEvent&, rEvent, void ) if( ! pMenu ) return; - if( rEvent.GetId() == VCLEVENT_WINDOW_SHOW ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID ); - else if( rEvent.GetId() == VCLEVENT_WINDOW_HIDE ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_HIDE, ITEMPOS_INVALID ); + if( rEvent.GetId() == VclEventId::WindowShow ) + pMenu->ImplCallEventListeners( VclEventId::MenuShow, ITEMPOS_INVALID ); + else if( rEvent.GetId() == VclEventId::WindowHide ) + pMenu->ImplCallEventListeners( VclEventId::MenuHide, ITEMPOS_INVALID ); } void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) @@ -502,7 +502,7 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b if ( nHighlightedItem != nRolloveredItem ) Invalidate(); //HighlightItem( nHighlightedItem, false ); - pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); + pMenu->ImplCallEventListeners( VclEventId::MenuDehighlight, nHighlightedItem ); } nHighlightedItem = (sal_uInt16)n; diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 366aeed1ad1d..79586c00c9cc 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -65,7 +65,7 @@ void MenuFloatingWindow::doShutdown() // #105373# notify toolkit that highlight was removed // otherwise the entry will not be read when the menu is opened again if( nHighlightedItem != ITEMPOS_INVALID ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); + pMenu->ImplCallEventListeners( VclEventId::MenuDehighlight, nHighlightedItem ); if (!bKeyInput && pMenu && pMenu->pStartedFrom && !pMenu->pStartedFrom->IsMenuBar()) { // #102461# remove highlight in parent @@ -374,10 +374,10 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent&, rEvent, void ) if( ! pMenu ) return; - if( rEvent.GetId() == VCLEVENT_WINDOW_SHOW ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID ); - else if( rEvent.GetId() == VCLEVENT_WINDOW_HIDE ) - pMenu->ImplCallEventListeners( VCLEVENT_MENU_HIDE, ITEMPOS_INVALID ); + if( rEvent.GetId() == VclEventId::WindowShow ) + pMenu->ImplCallEventListeners( VclEventId::MenuShow, ITEMPOS_INVALID ); + else if( rEvent.GetId() == VclEventId::WindowHide ) + pMenu->ImplCallEventListeners( VclEventId::MenuHide, ITEMPOS_INVALID ); } void MenuFloatingWindow::EnableScrollMenu( bool b ) @@ -444,7 +444,7 @@ void MenuFloatingWindow::StopExecute() } // notify parent, needed for accessibility if( pMenu && pMenu->pStartedFrom ) - pMenu->pStartedFrom->ImplCallEventListeners( VCLEVENT_MENU_SUBMENUDEACTIVATE, nPosInParent ); + pMenu->pStartedFrom->ImplCallEventListeners( VclEventId::MenuSubmenuDeactivate, nPosInParent ); } void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) @@ -703,7 +703,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime if ( nHighlightedItem != ITEMPOS_INVALID ) { InvalidateItem(nHighlightedItem); - pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); + pMenu->ImplCallEventListeners( VclEventId::MenuDehighlight, nHighlightedItem ); } nHighlightedItem = (sal_uInt16)n; diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 4d71a01a6ce3..52b9e3744bde 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -999,7 +999,7 @@ void Window::PostPaint(vcl::RenderContext& /*rRenderContext*/) void Window::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) { - CallEventListeners(VCLEVENT_WINDOW_PAINT, const_cast<Rectangle *>(&rRect)); + CallEventListeners(VclEventId::WindowPaint, const_cast<Rectangle *>(&rRect)); } void Window::SetPaintTransparent( bool bTransparent ) diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index 16b0e4101b07..6bb516eb956e 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -130,7 +130,7 @@ void Window::UpdateSettings( const AllSettings& rSettings, bool bChild ) DataChangedEvent aDCEvt( DataChangedEventType::SETTINGS, &aOldSettings, nChangeFlags ); DataChanged( aDCEvt ); // notify data change handler - CallEventListeners( VCLEVENT_WINDOW_DATACHANGED, &aDCEvt); + CallEventListeners( VclEventId::WindowDataChanged, &aDCEvt); } if ( bChild ) diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 019dc0545b24..cba9b3f1b912 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -732,8 +732,8 @@ void Window::ImplResetReallyVisible() // For this, the data member of the event must not be NULL. // Previously, we did this in Window::Show, but there some events got lost in certain situations. if( bBecameReallyInvisible && ImplIsAccessibleCandidate() ) - CallEventListeners( VCLEVENT_WINDOW_HIDE, this ); - // TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_HIDE. Normally, we should + CallEventListeners( VclEventId::WindowHide, this ); + // TODO. It's kind of a hack that we're re-using the VclEventId::WindowHide. Normally, we should // introduce another event which explicitly triggers the Accessibility implementations. vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap; diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 5a48fbdcd13b..8aab54b743a2 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -449,7 +449,7 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen } if (!rRenderContext.ImplIsRecordLayout()) - CallEventListeners(VCLEVENT_STATUSBAR_DRAWITEM, reinterpret_cast<void*>(pItem->mnId)); + CallEventListeners(VclEventId::StatusbarDrawItem, reinterpret_cast<void*>(pItem->mnId)); } void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, const Point& rPos, @@ -876,13 +876,13 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt ) void StatusBar::Click() { - CallEventListeners( VCLEVENT_STATUSBAR_CLICK ); + CallEventListeners( VclEventId::StatusbarClick ); maClickHdl.Call( this ); } void StatusBar::DoubleClick() { - CallEventListeners( VCLEVENT_STATUSBAR_DOUBLECLICK ); + CallEventListeners( VclEventId::StatusbarDoubleClick ); maDoubleClickHdl.Call( this ); } @@ -929,7 +929,7 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth, if ( ImplIsItemUpdate() ) Invalidate(); - CallEventListeners( VCLEVENT_STATUSBAR_ITEMADDED, reinterpret_cast<void*>(nItemId) ); + CallEventListeners( VclEventId::StatusbarItemAdded, reinterpret_cast<void*>(nItemId) ); } void StatusBar::RemoveItem( sal_uInt16 nItemId ) @@ -944,7 +944,7 @@ void StatusBar::RemoveItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - CallEventListeners( VCLEVENT_STATUSBAR_ITEMREMOVED, reinterpret_cast<void*>(nItemId) ); + CallEventListeners( VclEventId::StatusbarItemRemoved, reinterpret_cast<void*>(nItemId) ); } } @@ -963,7 +963,7 @@ void StatusBar::ShowItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - CallEventListeners( VCLEVENT_STATUSBAR_SHOWITEM, reinterpret_cast<void*>(nItemId) ); + CallEventListeners( VclEventId::StatusbarShowItem, reinterpret_cast<void*>(nItemId) ); } } } @@ -983,7 +983,7 @@ void StatusBar::HideItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - CallEventListeners( VCLEVENT_STATUSBAR_HIDEITEM, reinterpret_cast<void*>(nItemId) ); + CallEventListeners( VclEventId::StatusbarHideItem, reinterpret_cast<void*>(nItemId) ); } } } @@ -1010,7 +1010,7 @@ void StatusBar::Clear() if ( ImplIsItemUpdate() ) Invalidate(); - CallEventListeners( VCLEVENT_STATUSBAR_ALLITEMSREMOVED ); + CallEventListeners( VclEventId::StatusbarAllItemsRemoved ); } sal_uInt16 StatusBar::GetItemCount() const @@ -1468,7 +1468,7 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const OUString& rName ) if ( pItem->maAccessibleName != rName ) { pItem->maAccessibleName = rName; - CallEventListeners( VCLEVENT_STATUSBAR_NAMECHANGED, reinterpret_cast<void*>(pItem->mnId) ); + CallEventListeners( VclEventId::StatusbarNameChanged, reinterpret_cast<void*>(pItem->mnId) ); } } } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 100f12120f1c..1d19490c8368 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -272,7 +272,7 @@ TaskPaneList* SystemWindow::GetTaskPaneList() bool SystemWindow::Close() { VclPtr<vcl::Window> xWindow = this; - CallEventListeners( VCLEVENT_WINDOW_CLOSE ); + CallEventListeners( VclEventId::WindowClose ); if ( xWindow->IsDisposed() ) return false; @@ -936,7 +936,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) pOldWindow = nullptr; if ( pOldWindow ) { - CallEventListeners( VCLEVENT_WINDOW_MENUBARREMOVED, static_cast<void*>(pOldMenuBar) ); + CallEventListeners( VclEventId::WindowMenubarRemoved, static_cast<void*>(pOldMenuBar) ); pOldWindow->SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() ); } if ( pMenuBar ) @@ -946,7 +946,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar); static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow); - CallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, static_cast<void*>(pMenuBar) ); + CallEventListeners( VclEventId::WindowMenubarAdded, static_cast<void*>(pMenuBar) ); } else static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( nullptr ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 7d51ab3d1582..6ad9c21822fe 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3622,7 +3622,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) { InvalidateItem(mnCurPos); - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( mnCurPos ) ); + CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( mnCurPos ) ); } mnCurPos = nNewPos; @@ -3719,7 +3719,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) ImplHideFocus(); sal_uInt16 nPos = GetItemPos( mnHighItemId ); InvalidateItem(nPos); - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( nPos ) ); } if ( mpData->mbMenubuttonSelected ) { @@ -3729,7 +3729,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) mnHighItemId = it->mnId; InvalidateItem(nTempPos); ImplShowFocus(); - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT ); + CallEventListeners( VclEventId::ToolboxHighlight ); } } } @@ -3757,7 +3757,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) { InvalidateItem(nClearPos); if( nClearPos != mnCurPos ) - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) ); + CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( nClearPos ) ); } ImplHideFocus(); mnHighItemId = 0; @@ -5358,7 +5358,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus ) // set mnHighItemId to 0 already to prevent this hen/egg problem mnHighItemId = 0; InvalidateItem(nPos); - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( nPos ) ); } if( !bNoGrabFocus && pItem != pOldItem && pOldItem && pOldItem->mpWindow ) @@ -5401,7 +5401,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus ) if( pItem->mpWindow ) pItem->mpWindow->GrabFocus(); if( pItem != pOldItem ) - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT ); + CallEventListeners( VclEventId::ToolboxHighlight ); } } else diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 04ba01cd1603..38d8dd7a4531 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -299,7 +299,7 @@ void ToolBox::ImplInvalidate( bool bNewCalc, bool bFullPaint ) } // request new layout by layoutmanager - CallEventListeners( VCLEVENT_TOOLBOX_FORMATCHANGED ); + CallEventListeners( VclEventId::ToolboxFormatChanged ); } void ToolBox::ImplUpdateItem( sal_uInt16 nIndex ) @@ -327,40 +327,40 @@ void ToolBox::ImplUpdateItem( sal_uInt16 nIndex ) void ToolBox::Click() { - CallEventListeners( VCLEVENT_TOOLBOX_CLICK ); + CallEventListeners( VclEventId::ToolboxClick ); maClickHdl.Call( this ); } void ToolBox::DoubleClick() { - CallEventListeners( VCLEVENT_TOOLBOX_DOUBLECLICK ); + CallEventListeners( VclEventId::ToolboxDoubleClick ); maDoubleClickHdl.Call( this ); } void ToolBox::Activate() { mnActivateCount++; - CallEventListeners( VCLEVENT_TOOLBOX_ACTIVATE ); + CallEventListeners( VclEventId::ToolboxActivate ); maActivateHdl.Call( this ); } void ToolBox::Deactivate() { mnActivateCount--; - CallEventListeners( VCLEVENT_TOOLBOX_DEACTIVATE ); + CallEventListeners( VclEventId::ToolboxDeactivate ); maDeactivateHdl.Call( this ); } void ToolBox::Highlight() { - CallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT ); + CallEventListeners( VclEventId::ToolboxHighlight ); } void ToolBox::Select() { VclPtr<vcl::Window> xWindow = this; - CallEventListeners( VCLEVENT_TOOLBOX_SELECT ); + CallEventListeners( VclEventId::ToolboxSelect ); maSelectHdl.Call( this ); if ( xWindow->IsDisposed() ) @@ -388,7 +388,7 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, ToolBoxItemBi // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >(nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >(nNewPos ) ); } void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUString& rText, ToolBoxItemBits nBits, @@ -408,7 +408,7 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUStrin // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::InsertItem( sal_uInt16 nItemId, const OUString& rText, ToolBoxItemBits nBits, sal_uInt16 nPos ) @@ -426,7 +426,7 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const OUString& rText, ToolBoxItem // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::InsertItem(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame, ToolBoxItemBits nBits, @@ -479,7 +479,7 @@ void ToolBox::InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow, // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::InsertSpace() @@ -495,7 +495,7 @@ void ToolBox::InsertSpace() // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize ) @@ -513,7 +513,7 @@ void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize ) // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::InsertBreak( sal_uInt16 nPos ) @@ -529,7 +529,7 @@ void ToolBox::InsertBreak( sal_uInt16 nPos ) // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos ) ); } void ToolBox::RemoveItem( sal_uInt16 nPos ) @@ -560,7 +560,7 @@ void ToolBox::RemoveItem( sal_uInt16 nPos ) mpData->ImplClearLayoutData(); // Notify - CallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxItemRemoved, reinterpret_cast< void* >( nPos ) ); } } @@ -587,7 +587,7 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId ) // Notify sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); + CallEventListeners( VclEventId::ToolboxItemAdded, reinterpret_cast< void* >( nNewPos2 ) ); } } @@ -603,7 +603,7 @@ void ToolBox::Clear() ImplInvalidate( true, true ); // Notify - CallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED ); + CallEventListeners( VclEventId::ToolboxAllItemsChanged ); } void ToolBox::SetButtonType( ButtonType eNewType ) @@ -1078,10 +1078,10 @@ void ToolBox::SetItemText( sal_uInt16 nItemId, const OUString& rText ) pItem->maText = MnemonicGenerator::EraseAllMnemonicChars(rText); // Notify button changed event to prepare accessibility bridge - CallEventListeners( VCLEVENT_TOOLBOX_BUTTONSTATECHANGED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxButtonStateChanged, reinterpret_cast< void* >( nPos ) ); // Notify - CallEventListeners( VCLEVENT_TOOLBOX_ITEMTEXTCHANGED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxItemTextChanged, reinterpret_cast< void* >( nPos ) ); } } @@ -1106,7 +1106,7 @@ void ToolBox::SetItemWindow( sal_uInt16 nItemId, vcl::Window* pNewWindow ) if ( pNewWindow ) pNewWindow->Hide(); ImplInvalidate( true ); - CallEventListeners( VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxItemWindowChanged, reinterpret_cast< void* >( nPos ) ); } } @@ -1252,10 +1252,10 @@ void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState ) ImplUpdateItem( nPos ); // Notify button changed event to prepare accessibility bridge - CallEventListeners( VCLEVENT_TOOLBOX_BUTTONSTATECHANGED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxButtonStateChanged, reinterpret_cast< void* >( nPos ) ); // Call accessible listener to notify state_changed event - CallEventListeners( VCLEVENT_TOOLBOX_ITEMUPDATED, reinterpret_cast< void* >(nPos) ); + CallEventListeners( VclEventId::ToolboxItemUpdated, reinterpret_cast< void* >(nPos) ); } } } @@ -1293,9 +1293,9 @@ void ToolBox::EnableItem( sal_uInt16 nItemId, bool bEnable ) ImplUpdateInputEnable(); // Notify button changed event to prepare accessibility bridge - CallEventListeners( VCLEVENT_TOOLBOX_BUTTONSTATECHANGED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( VclEventId::ToolboxButtonStateChanged, reinterpret_cast< void* >( nPos ) ); - CallEventListeners( bEnable ? VCLEVENT_TOOLBOX_ITEMENABLED : VCLEVENT_TOOLBOX_ITEMDISABLED, reinterpret_cast< void* >( nPos ) ); + CallEventListeners( bEnable ? VclEventId::ToolboxItemEnabled : VclEventId::ToolboxItemDisabled, reinterpret_cast< void* >( nPos ) ); } } } @@ -1672,7 +1672,7 @@ void ToolBox::UpdateCustomMenu() IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent&, rEvent, void ) { - if( rEvent.GetMenu() == GetMenu() && rEvent.GetId() == VCLEVENT_MENU_SELECT ) + if( rEvent.GetMenu() == GetMenu() && rEvent.GetId() == VclEventId::MenuSelect ) { sal_uInt16 id = GetMenu()->GetItemId( rEvent.GetItemPos() ); if( id >= TOOLBOX_MENUITEM_START ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 7bba641f6463..1bf8a4defef3 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -164,12 +164,12 @@ void Window::dispose() mpWindowImpl->mbInDispose = true; - CallEventListeners( VCLEVENT_OBJECT_DYING ); + CallEventListeners( VclEventId::ObjectDying ); // do not send child events for frames that were registered as native frames if( !ImplIsAccessibleNativeFrame() && mpWindowImpl->mbReallyVisible ) if ( ImplIsAccessibleCandidate() && GetAccessibleParentWindow() ) - GetAccessibleParentWindow()->CallEventListeners( VCLEVENT_WINDOW_CHILDDESTROYED, this ); + GetAccessibleParentWindow()->CallEventListeners( VclEventId::WindowChildDestroyed, this ); // remove associated data structures from dockingmanager ImplGetDockingManager()->RemoveWindow( this ); @@ -1178,7 +1178,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p ImplInitAppFontData( this ); if ( GetAccessibleParentWindow() && GetParent() != Application::GetDefDialogParent() ) - GetAccessibleParentWindow()->CallEventListeners( VCLEVENT_WINDOW_CHILDCREATED, this ); + GetAccessibleParentWindow()->CallEventListeners( VclEventId::WindowChildCreated, this ); } void Window::ImplInitAppFontData( vcl::Window* pWindow ) @@ -1300,8 +1300,8 @@ void Window::ImplSetReallyVisible() // Previously, we did this in Window::Show, but there some events got lost in certain situations. Now // we're doing it when the visibility really changes if( bBecameReallyVisible && ImplIsAccessibleCandidate() ) - CallEventListeners( VCLEVENT_WINDOW_SHOW, this ); - // TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_SHOW. Normally, we should + CallEventListeners( VclEventId::WindowShow, this ); + // TODO. It's kind of a hack that we're re-using the VclEventId::WindowShow. Normally, we should // introduce another event which explicitly triggers the Accessibility implementations. vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap; @@ -1914,7 +1914,7 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) void Window::Command( const CommandEvent& rCEvt ) { - CallEventListeners( VCLEVENT_WINDOW_COMMAND, const_cast<CommandEvent *>(&rCEvt) ); + CallEventListeners( VclEventId::WindowCommand, const_cast<CommandEvent *>(&rCEvt) ); NotifyEvent aNEvt( MouseNotifyEvent::COMMAND, this, &rCEvt ); if ( !CompatNotify( aNEvt ) ) @@ -2383,7 +2383,7 @@ void Window::Show(bool bVisible, ShowFlags nFlags) // Since #104887#, the notifications for the access bridge are done in Impl(Set|Reset)ReallyVisible. Here, we // now only notify with a NULL data pointer, for all other clients except the access bridge. if ( !bRealVisibilityChanged ) - CallEventListeners( mpWindowImpl->mbVisible ? VCLEVENT_WINDOW_SHOW : VCLEVENT_WINDOW_HIDE ); + CallEventListeners( mpWindowImpl->mbVisible ? VclEventId::WindowShow : VclEventId::WindowHide ); if( xWindow->IsDisposed() ) return; @@ -2465,7 +2465,7 @@ void Window::Enable( bool bEnable, bool bChild ) mpWindowImpl->mpSysObj->Enable( bEnable && !mpWindowImpl->mbInputDisabled ); CompatStateChanged( StateChangedType::Enable ); - CallEventListeners( bEnable ? VCLEVENT_WINDOW_ENABLED : VCLEVENT_WINDOW_DISABLED ); + CallEventListeners( bEnable ? VclEventId::WindowEnabled : VclEventId::WindowDisabled ); } if ( bChild ) @@ -3060,17 +3060,17 @@ void Window::SetText( const OUString& rStr ) else if ( mpWindowImpl->mbFrame ) mpWindowImpl->mpFrame->SetTitle( rStr ); - CallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle ); + CallEventListeners( VclEventId::WindowFrameTitleChanged, &oldTitle ); // #107247# needed for accessibility - // The VCLEVENT_WINDOW_FRAMETITLECHANGED is (mis)used to notify accessible name changes. + // The VclEventId::WindowFrameTitleChanged is (mis)used to notify accessible name changes. // Therefore a window, which is labeled by this window, must also notify an accessible // name change. if ( IsReallyVisible() ) { vcl::Window* pWindow = GetAccessibleRelationLabelFor(); if ( pWindow && pWindow != this ) - pWindow->CallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle ); + pWindow->CallEventListeners( VclEventId::WindowFrameTitleChanged, &oldTitle ); } CompatStateChanged( StateChangedType::Text ); @@ -3184,7 +3184,7 @@ void Window::ImplCallDeactivateListeners( vcl::Window *pNew ) if ( !pNew || !ImplIsChild( pNew ) ) { VclPtr<vcl::Window> xWindow(this); - CallEventListeners( VCLEVENT_WINDOW_DEACTIVATE ); + CallEventListeners( VclEventId::WindowDeactivate ); if( xWindow->IsDisposed() ) return; @@ -3201,7 +3201,7 @@ void Window::ImplCallActivateListeners( vcl::Window *pOld ) if ( !pOld || !ImplIsChild( pOld ) ) { VclPtr<vcl::Window> xWindow(this); - CallEventListeners( VCLEVENT_WINDOW_ACTIVATE, pOld ); + CallEventListeners( VclEventId::WindowActivate, pOld ); if( xWindow->IsDisposed() ) return; @@ -3473,10 +3473,10 @@ void Window::ImplIsInTaskPaneList( bool mbIsInTaskList ) void Window::ImplNotifyIconifiedState( bool bIconified ) { - mpWindowImpl->mpFrameWindow->CallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE ); + mpWindowImpl->mpFrameWindow->CallEventListeners( bIconified ? VclEventId::WindowMinimize : VclEventId::WindowNormalize ); // #109206# notify client window as well to have toolkit topwindow listeners notified if( mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow && mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow ) - mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->CallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE ); + mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->CallEventListeners( bIconified ? VclEventId::WindowMinimize : VclEventId::WindowNormalize ); } bool Window::HasActiveChildFrame() diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 4b5ce2a4f4f0..effc5bb0591a 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -862,20 +862,20 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, KeyEvent aKeyEvent( (sal_Unicode)nCharCode, aKeyCode, nRepeat ); if( bForward ) { - sal_uInt16 nVCLEvent; + VclEventId nVCLEvent; switch( nSVEvent ) { case MouseNotifyEvent::KEYINPUT: - nVCLEvent = VCLEVENT_WINDOW_KEYINPUT; + nVCLEvent = VclEventId::WindowKeyInput; break; case MouseNotifyEvent::KEYUP: - nVCLEvent = VCLEVENT_WINDOW_KEYUP; + nVCLEvent = VclEventId::WindowKeyUp; break; default: - nVCLEvent = 0; + nVCLEvent = VclEventId::NONE; break; } - if( nVCLEvent && Application::HandleKey( nVCLEvent, pWindow, &aKeyEvent ) ) + if( nVCLEvent != VclEventId::NONE && Application::HandleKey( nVCLEvent, pWindow, &aKeyEvent ) ) return true; } diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 34192595a8de..e2f3573125e3 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -508,11 +508,11 @@ static void handle_get_focus(::VclWindowEvent const * pEvent) vcl::Window *pWindow = pEvent->GetWindow(); - // The menu bar is handled through VCLEVENT_MENU_HIGHLIGHTED + // The menu bar is handled through VclEventId::MenuHighlightED if( ! pWindow || !pWindow->IsReallyVisible() || pWindow->GetType() == WINDOW_MENUBARWINDOW ) return; - // ToolBoxes are handled through VCLEVENT_TOOLBOX_HIGHLIGHT + // ToolBoxes are handled through VclEventId::ToolboxHighlight if( pWindow->GetType() == WINDOW_TOOLBOX ) return; @@ -601,28 +601,28 @@ void WindowEventHandler(void *, VclSimpleEvent& rEvent) { switch (rEvent.GetId()) { - case VCLEVENT_WINDOW_SHOW: + case VclEventId::WindowShow: break; - case VCLEVENT_WINDOW_HIDE: + case VclEventId::WindowHide: break; - case VCLEVENT_WINDOW_CLOSE: + case VclEventId::WindowClose: break; - case VCLEVENT_WINDOW_GETFOCUS: + case VclEventId::WindowGetFocus: handle_get_focus(static_cast< ::VclWindowEvent const * >(&rEvent)); break; - case VCLEVENT_WINDOW_LOSEFOCUS: + case VclEventId::WindowLoseFocus: break; - case VCLEVENT_WINDOW_MINIMIZE: + case VclEventId::WindowMinimize: break; - case VCLEVENT_WINDOW_NORMALIZE: + case VclEventId::WindowNormalize: break; - case VCLEVENT_WINDOW_KEYINPUT: - case VCLEVENT_WINDOW_KEYUP: - case VCLEVENT_WINDOW_COMMAND: - case VCLEVENT_WINDOW_MOUSEMOVE: + case VclEventId::WindowKeyInput: + case VclEventId::WindowKeyUp: + case VclEventId::WindowCommand: + case VclEventId::WindowMouseMove: break; - case VCLEVENT_MENU_HIGHLIGHT: + case VclEventId::MenuHighlight: if (const VclMenuEvent* pMenuEvent = dynamic_cast<const VclMenuEvent*>(&rEvent)) { handle_menu_highlighted(pMenuEvent); @@ -635,26 +635,26 @@ void WindowEventHandler(void *, VclSimpleEvent& rEvent) } break; - case VCLEVENT_TOOLBOX_HIGHLIGHT: + case VclEventId::ToolboxHighlight: handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); break; - case VCLEVENT_TOOLBOX_BUTTONSTATECHANGED: + case VclEventId::ToolboxButtonStateChanged: handle_toolbox_buttonchange(static_cast< ::VclWindowEvent const * >(&rEvent)); break; - case VCLEVENT_OBJECT_DYING: + case VclEventId::ObjectDying: g_aWindowList.list.erase( static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow() ); SAL_FALLTHROUGH; - case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: + case VclEventId::ToolboxHighlightOff: handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); break; - case VCLEVENT_TABPAGE_ACTIVATE: + case VclEventId::TabpageActivate: handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); break; - case VCLEVENT_COMBOBOX_SETTEXT: + case VclEventId::ComboboxSetText: // This looks quite strange to me. Stumbled over this when fixing #i104290#. // This kicked in when leaving the combobox in the toolbar, after that the events worked. // I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore. |