diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2022-09-02 00:04:39 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-05 16:20:03 +0200 |
commit | 99b85a2eda006a59306042dad5b0b1de116febf3 (patch) | |
tree | 8508c83afa26f2898609b08943cc1530f0f0830e | |
parent | c8cc4c29369f3d5df22c0b9260c00816a7c891eb (diff) |
vcl: Rename Gesture event to GesturePan
We have 5 gesture types: GestureZoom, GestureRotate, Gesture (for
panning), Swipe and LongPress. For consistency all of these will use
Gesture as a prefix to reduce confusion and for easier grepping
throughout the codebase.
Change-Id: I8b9e245d011203a19c1172f9833c172f65382ca9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139241
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | bin/find-can-be-private-symbols.functions.results | 2 | ||||
-rw-r--r-- | compilerplugins/clang/constantparam.numbers.results | 2 | ||||
-rw-r--r-- | compilerplugins/clang/unusedenumconstants.writeonly.results | 4 | ||||
-rw-r--r-- | compilerplugins/clang/unusedfields.only-used-in-constructor.results | 6 | ||||
-rw-r--r-- | compilerplugins/clang/unusedfields.untouched.results | 6 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 10 | ||||
-rw-r--r-- | include/vcl/GestureEventPan.hxx (renamed from include/vcl/GestureEvent.hxx) | 20 | ||||
-rw-r--r-- | include/vcl/commandevent.hxx | 15 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/salwtype.hxx | 6 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 9 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/treelist/svimpbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/commandevent.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 16 |
17 files changed, 63 insertions, 60 deletions
diff --git a/bin/find-can-be-private-symbols.functions.results b/bin/find-can-be-private-symbols.functions.results index 477c1971f137..89e04cb7696a 100644 --- a/bin/find-can-be-private-symbols.functions.results +++ b/bin/find-can-be-private-symbols.functions.results @@ -267,7 +267,7 @@ ComboBox::SetWidthInChars(int) ComboBox::setMaxWidthChars(int) CommandEvent::CommandEvent() CommandEvent::GetAutoScrollData() const -CommandEvent::GetGestureData() const +CommandEvent::GetGesturePanData() const CommandExtTextInputData::CommandExtTextInputData(CommandExtTextInputData const&) CommandWheelData::CommandWheelData() CompressGraphicsDialog::Compress(SvStream&) diff --git a/compilerplugins/clang/constantparam.numbers.results b/compilerplugins/clang/constantparam.numbers.results index 34a32601044d..4dab02d8179c 100644 --- a/compilerplugins/clang/constantparam.numbers.results +++ b/compilerplugins/clang/constantparam.numbers.results @@ -1487,7 +1487,7 @@ include/vcl/print.hxx:667 int i_nMaxValue 1000 include/vcl/svapp.hxx:752 - struct ImplSVEvent * Application::PostGestureEvent(enum VclEventId,class vcl::Window *,const class GestureEvent *) + struct ImplSVEvent * Application::PostGestureEvent(enum VclEventId,class vcl::Window *,const class GestureEventPan *) enum VclEventId nEvent 130 include/vcl/texteng.hxx:132 diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results b/compilerplugins/clang/unusedenumconstants.writeonly.results index b4f02f215137..e22323c9d683 100644 --- a/compilerplugins/clang/unusedenumconstants.writeonly.results +++ b/compilerplugins/clang/unusedenumconstants.writeonly.results @@ -2900,9 +2900,9 @@ include/vcl/formatter.hxx:120 enum Formatter::valueState valueDirty include/vcl/gdimtf.hxx:48 enum MtfConversion N8BitGreys -include/vcl/GestureEvent.hxx:25 +include/vcl/GestureEventPan.hxx:25 enum PanningOrientation Horizontal -include/vcl/GestureEvent.hxx:26 +include/vcl/GestureEventPan.hxx:26 enum PanningOrientation Vertical include/vcl/GraphicObject.hxx:40 enum GraphicAdjustmentFlags ALL diff --git a/compilerplugins/clang/unusedfields.only-used-in-constructor.results b/compilerplugins/clang/unusedfields.only-used-in-constructor.results index 858713811d6b..d22fb2d35d4d 100644 --- a/compilerplugins/clang/unusedfields.only-used-in-constructor.results +++ b/compilerplugins/clang/unusedfields.only-used-in-constructor.results @@ -373,11 +373,11 @@ include/svx/ClassificationDialog.hxx:37 include/svx/imapdlg.hxx:91 SvxIMapDlg aIMapItem SvxIMapDlgItem include/vcl/commandevent.hxx:310 - CommandGestureData mfX const double + CommandGesturePanData mfX const double include/vcl/commandevent.hxx:311 - CommandGestureData mfY const double + CommandGesturePanData mfY const double include/vcl/commandevent.hxx:314 - CommandGestureData meOrientation const PanningOrientation + CommandGesturePanData meOrientation const PanningOrientation include/vcl/pdf/PDFAnnotationMarker.hxx:67 vcl::pdf::PDFAnnotationMarkerHighlight meTextMarkerType PDFTextMarkerType include/xmloff/shapeimport.hxx:57 diff --git a/compilerplugins/clang/unusedfields.untouched.results b/compilerplugins/clang/unusedfields.untouched.results index e70d7f71426d..3366f862141a 100644 --- a/compilerplugins/clang/unusedfields.untouched.results +++ b/compilerplugins/clang/unusedfields.untouched.results @@ -223,11 +223,11 @@ include/svx/imapdlg.hxx:91 include/unotest/macros_test.hxx:111 unotest::MacrosTest mpDll std::unique_ptr<BasicDLL> include/vcl/commandevent.hxx:310 - CommandGestureData mfX const double + CommandGesturePanData mfX const double include/vcl/commandevent.hxx:311 - CommandGestureData mfY const double + CommandGesturePanData mfY const double include/vcl/commandevent.hxx:314 - CommandGestureData meOrientation const PanningOrientation + CommandGesturePanData meOrientation const PanningOrientation include/vcl/filter/PngImageReader.hxx:35 vcl::PngImageReader mxStatusIndicator css::uno::Reference<css::task::XStatusIndicator> include/vcl/filter/PngImageWriter.hxx:32 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 95f96ee67cf4..6b932f8c7b53 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -121,7 +121,7 @@ #include <svx/svxids.hrc> #include <svx/ucsubset.hxx> #include <vcl/vclevent.hxx> -#include <vcl/GestureEvent.hxx> +#include <vcl/GestureEventPan.hxx> #include <vcl/svapp.hxx> #include <unotools/resmgr.hxx> #include <tools/fract.hxx> @@ -4633,14 +4633,14 @@ static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsign } OString aType(pType); - GestureEventType eEventType = GestureEventType::PanningUpdate; + GestureEventPanType eEventType = GestureEventPanType::Update; if (aType == "panBegin") - eEventType = GestureEventType::PanningBegin; + eEventType = GestureEventPanType::Begin; else if (aType == "panEnd") - eEventType = GestureEventType::PanningEnd; + eEventType = GestureEventPanType::End; - GestureEvent aEvent { + GestureEventPan aEvent { sal_Int32(nX), sal_Int32(nY), eEventType, diff --git a/include/vcl/GestureEvent.hxx b/include/vcl/GestureEventPan.hxx index 7b6f25719c7a..23ad80986d1f 100644 --- a/include/vcl/GestureEvent.hxx +++ b/include/vcl/GestureEventPan.hxx @@ -13,11 +13,11 @@ #include <vcl/dllapi.h> -enum class GestureEventType +enum class GestureEventPanType { - PanningBegin, - PanningUpdate, - PanningEnd + Begin, + Update, + End }; enum class PanningOrientation @@ -26,27 +26,27 @@ enum class PanningOrientation Vertical }; -class VCL_DLLPUBLIC GestureEvent +class VCL_DLLPUBLIC GestureEventPan { public: sal_Int32 mnX; sal_Int32 mnY; - GestureEventType meEventType; + GestureEventPanType meEventType; sal_Int32 mnOffset; PanningOrientation meOrientation; - GestureEvent() + GestureEventPan() : mnX(0) , mnY(0) - , meEventType(GestureEventType::PanningBegin) + , meEventType(GestureEventPanType::Begin) , mnOffset(0) , meOrientation(PanningOrientation::Horizontal) { } - GestureEvent(sal_Int32 nX, sal_Int32 nY, GestureEventType eEventType, sal_Int32 nOffset, - PanningOrientation eOrientation) + GestureEventPan(sal_Int32 nX, sal_Int32 nY, GestureEventPanType eEventType, sal_Int32 nOffset, + PanningOrientation eOrientation) : mnX(nX) , mnY(nY) , meEventType(eEventType) diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index 7b3199b18ccd..9708ab818101 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -27,7 +27,7 @@ #include <vcl/keycodes.hxx> #include <o3tl/typed_flags_set.hxx> #include <rtl/ustring.hxx> -#include <vcl/GestureEvent.hxx> +#include <vcl/GestureEventPan.hxx> #include <vcl/GestureEventZoom.hxx> #include <vcl/GestureEventRotate.hxx> @@ -40,7 +40,7 @@ class CommandMediaData; class CommandSelectionChangeData; class CommandSwipeData; class CommandLongPressData; -class CommandGestureData; +class CommandGesturePanData; class CommandGestureZoomData; class CommandGestureRotateData; @@ -93,7 +93,7 @@ public: const CommandSelectionChangeData* GetSelectionChangeData() const; const CommandSwipeData* GetSwipeData() const; const CommandLongPressData* GetLongPressData() const; - const CommandGestureData* GetGestureData() const; + const CommandGesturePanData* GetGesturePanData() const; const CommandGestureZoomData* GetGestureZoomData() const; const CommandGestureRotateData* GetGestureRotateData() const; }; @@ -310,16 +310,17 @@ public: double getY() const { return mnY; } }; -class VCL_DLLPUBLIC CommandGestureData +class VCL_DLLPUBLIC CommandGesturePanData { public: double const mfX; double const mfY; double const mfOffset; - GestureEventType const meEventType; + GestureEventPanType const meEventType; PanningOrientation const meOrientation; - CommandGestureData(double fX, double fY, GestureEventType eEventType, double fOffset, PanningOrientation eOrientation) + CommandGesturePanData(double fX, double fY, GestureEventPanType eEventType, double fOffset, + PanningOrientation eOrientation) : mfX(fX) , mfY(fY) , mfOffset(fOffset) @@ -384,7 +385,7 @@ enum class CommandEventId QueryCharPosition = 20, Swipe = 21, LongPress = 22, - Gesture = 23, + GesturePan = 23, GestureZoom = 24, GestureRotate = 25, }; diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 22164ed78d4c..93dd4873009b 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -63,7 +63,7 @@ namespace vcl { class KeyCode; } class NotifyEvent; class KeyEvent; class MouseEvent; -class GestureEvent; +class GestureEventPan; struct ImplSVEvent; struct ConvertData; @@ -752,7 +752,8 @@ public: */ static ImplSVEvent * PostMouseEvent( VclEventId nEvent, vcl::Window *pWin, MouseEvent const * pMouseEvent ); - static ImplSVEvent* PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, GestureEvent const * pGestureEvent); + static ImplSVEvent* PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, + GestureEventPan const * pGestureEvent); /** Remove mouse and keypress events from a window... any also zoom and scroll events if the platform supports it. diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index 7b66ef5a2d45..55de89464c3f 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -25,7 +25,7 @@ #include <rtl/ustring.hxx> #include <tools/solar.h> #include <tools/long.hxx> -#include <vcl/GestureEvent.hxx> +#include <vcl/GestureEventPan.hxx> #include <vcl/GestureEventZoom.hxx> #include <vcl/GestureEventRotate.hxx> @@ -92,7 +92,7 @@ enum class SalEvent { Swipe, LongPress, ExternalGesture, - Gesture, + GesturePan, GestureZoom, GestureRotate, }; @@ -260,7 +260,7 @@ struct SalLongPressEvent struct SalGestureEvent { - GestureEventType meEventType; + GestureEventPanType meEventType; PanningOrientation meOrientation; double mfOffset; tools::Long mnX; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 0fc4a2b00e36..b5544586d341 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -127,7 +127,7 @@ struct ImplPostEventData MouseEvent maMouseEvent; VclEventId mnEvent; KeyEvent maKeyEvent; - GestureEvent maGestureEvent; + GestureEventPan maGestureEvent; ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const KeyEvent& rKeyEvent) : mpWin(pWin) @@ -141,7 +141,7 @@ struct ImplPostEventData , maMouseEvent(rMouseEvent) , mnEvent(nEvent) {} - ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const GestureEvent& rGestureEvent) + ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const GestureEventPan& rGestureEvent) : mpWin(pWin) , mnEventId(nullptr) , mnEvent(nEvent) @@ -890,7 +890,8 @@ ImplSVEvent * Application::PostKeyEvent( VclEventId nEvent, vcl::Window *pWin, K return nEventId; } -ImplSVEvent* Application::PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, GestureEvent const * pGestureEvent) +ImplSVEvent* Application::PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, + GestureEventPan const * pGestureEvent) { const SolarMutexGuard aGuard; ImplSVEvent * nEventId = nullptr; @@ -902,7 +903,7 @@ ImplSVEvent* Application::PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, aTransformedPosition.AdjustX(pWin->GetOutOffXPixel()); aTransformedPosition.AdjustY(pWin->GetOutOffYPixel()); - const GestureEvent aGestureEvent( + const GestureEventPan aGestureEvent( sal_Int32(aTransformedPosition.X()), sal_Int32(aTransformedPosition.Y()), pGestureEvent->meEventType, diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index fbd655eb04dd..0bf583b073fd 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -2393,7 +2393,7 @@ bool ImplListBox::EventNotify( NotifyEvent& rNEvt ) bDone = HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar ); } } - else if (rCEvt.GetCommand() == CommandEventId::Gesture) + else if (rCEvt.GetCommand() == CommandEventId::GesturePan) { bDone = HandleScrollCommand(rCEvt, mpHScrollBar, mpVScrollBar); } diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index a647e2df3402..82b79b2931c3 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -626,7 +626,7 @@ bool ImpVclMEdit::HandleCommand( const CommandEvent& rCEvt ) if (nCommand == CommandEventId::Wheel || nCommand == CommandEventId::StartAutoScroll || nCommand == CommandEventId::AutoScroll || - nCommand == CommandEventId::Gesture) + nCommand == CommandEventId::GesturePan) { ScrollBar* pHScrollBar = mpHScrollBar->IsVisible() ? mpHScrollBar.get() : nullptr; ScrollBar* pVScrollBar = mpVScrollBar->IsVisible() ? mpVScrollBar.get() : nullptr; diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index 5f90c85642f8..b9a311822be1 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2836,7 +2836,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) if (nCommand == CommandEventId::Wheel || nCommand == CommandEventId::StartAutoScroll || nCommand == CommandEventId::AutoScroll || - nCommand == CommandEventId::Gesture) + nCommand == CommandEventId::GesturePan) { if (m_pView->HandleScrollCommand(rCEvt, m_aHorSBar.get(), m_aVerSBar.get())) return; diff --git a/vcl/source/window/commandevent.cxx b/vcl/source/window/commandevent.cxx index 5fdb5e9e41a1..53be6515a3f7 100644 --- a/vcl/source/window/commandevent.cxx +++ b/vcl/source/window/commandevent.cxx @@ -187,10 +187,10 @@ const CommandLongPressData* CommandEvent::GetLongPressData() const return nullptr; } -const CommandGestureData* CommandEvent::GetGestureData() const +const CommandGesturePanData* CommandEvent::GetGesturePanData() const { - if (mnCommand == CommandEventId::Gesture) - return static_cast<const CommandGestureData*>(mpData); + if (mnCommand == CommandEventId::GesturePan) + return static_cast<const CommandGesturePanData*>(mpData); else return nullptr; } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 4d41c9ddf382..b6c4ee25415a 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -763,21 +763,21 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd, } break; - case CommandEventId::Gesture: + case CommandEventId::GesturePan: { if (pVScrl) { - const CommandGestureData* pData = rCmd.GetGestureData(); - if (pData->meEventType == GestureEventType::PanningBegin) + const CommandGesturePanData* pData = rCmd.GetGesturePanData(); + if (pData->meEventType == GestureEventPanType::Begin) { mpWindowImpl->mpFrameData->mnTouchPanPosition = pVScrl->GetThumbPos(); } - else if(pData->meEventType == GestureEventType::PanningUpdate) + else if(pData->meEventType == GestureEventPanType::Update) { tools::Long nOriginalPosition = mpWindowImpl->mpFrameData->mnTouchPanPosition; pVScrl->DoScroll(nOriginalPosition + (pData->mfOffset / pVScrl->GetVisibleSize())); } - if (pData->meEventType == GestureEventType::PanningEnd) + if (pData->meEventType == GestureEventPanType::End) { mpWindowImpl->mpFrameData->mnTouchPanPosition = -1; } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index d98b8c2fae42..efa818d7b60e 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -31,7 +31,7 @@ #include <vcl/QueueInfo.hxx> #include <vcl/timer.hxx> #include <vcl/event.hxx> -#include <vcl/GestureEvent.hxx> +#include <vcl/GestureEventPan.hxx> #include <vcl/GestureEventZoom.hxx> #include <vcl/GestureEventRotate.hxx> #include <vcl/settings.hxx> @@ -1795,13 +1795,13 @@ static bool ImplHandleLongPress(vcl::Window *pWindow, const SalLongPressEvent& r namespace { -class HandleGeneralGestureEvent : public HandleGestureEvent +class HandleGesturePanEvent : public HandleGestureEvent { private: - CommandGestureData m_aGestureData; + CommandGesturePanData m_aGestureData; public: - HandleGeneralGestureEvent(vcl::Window* pWindow, const SalGestureEvent& rEvent) + HandleGesturePanEvent(vcl::Window* pWindow, const SalGestureEvent& rEvent) : HandleGestureEvent(pWindow, Point(rEvent.mnX, rEvent.mnY)) , m_aGestureData(rEvent.mnX, rEvent.mnY, rEvent.meEventType, rEvent.mfOffset, rEvent.meOrientation) { @@ -1809,7 +1809,7 @@ public: virtual bool CallCommand(vcl::Window* pWindow, const Point& /*rMousePos*/) override { - return ImplCallCommand(pWindow, CommandEventId::Gesture, &m_aGestureData); + return ImplCallCommand(pWindow, CommandEventId::GesturePan, &m_aGestureData); } }; @@ -1817,7 +1817,7 @@ public: static bool ImplHandleGestureEvent(vcl::Window* pWindow, const SalGestureEvent& rEvent) { - HandleGeneralGestureEvent aHandler(pWindow, rEvent); + HandleGesturePanEvent aHandler(pWindow, rEvent); return aHandler.HandleEvent(); } @@ -2913,7 +2913,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE case SalEvent::ExternalGesture: { - auto const * pGestureEvent = static_cast<GestureEvent const *>(pEvent); + auto const * pGestureEvent = static_cast<GestureEventPan const *>(pEvent); SalGestureEvent aSalGestureEvent; aSalGestureEvent.mfOffset = pGestureEvent->mnOffset; @@ -2925,7 +2925,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE bRet = ImplHandleGestureEvent(pWindow, aSalGestureEvent); } break; - case SalEvent::Gesture: + case SalEvent::GesturePan: { auto const * aSalGestureEvent = static_cast<SalGestureEvent const *>(pEvent); bRet = ImplHandleGestureEvent(pWindow, *aSalGestureEvent); |