diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-03-25 18:05:35 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-03-26 01:30:45 +0100 |
commit | 6b476080da0678faa59606ef814760bd4235de24 (patch) | |
tree | 44e25707777a784e231a66b4addfeab2d8ccdd50 /include | |
parent | d3922a93a096e07ab54e91fd0dd7c86302f33b78 (diff) |
tdf#124146 add (general) gesture event support to VCL
Change-Id: I766930bb35071442e132b91477cd3d55e8f00f48
Reviewed-on: https://gerrit.libreoffice.org/69655
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/GestureEvent.hxx | 42 | ||||
-rw-r--r-- | include/vcl/commandevent.hxx | 24 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 3 | ||||
-rw-r--r-- | include/vcl/vclevent.hxx | 1 |
4 files changed, 70 insertions, 0 deletions
diff --git a/include/vcl/GestureEvent.hxx b/include/vcl/GestureEvent.hxx new file mode 100644 index 000000000000..2070fc76d39a --- /dev/null +++ b/include/vcl/GestureEvent.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_VCL_GESTUREEVENT_HXX +#define INCLUDED_VCL_GESTUREEVENT_HXX + +#include <vcl/dllapi.h> + +enum class GestureEventType +{ + PanningBegin, + PanningUpdate, + PanningEnd +}; + +enum class PanningOrientation +{ + Horizontal, + Vertical +}; + +class VCL_DLLPUBLIC GestureEvent +{ +public: + sal_Int32 mnX; + sal_Int32 mnY; + GestureEventType meEventType; + + sal_Int32 mnOffset; + PanningOrientation meOrientation; +}; + +#endif // INCLUDED_VCL_GESTUREEVENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index 88185efde077..a3ee2fb73c99 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -27,6 +27,7 @@ #include <vcl/keycodes.hxx> #include <o3tl/typed_flags_set.hxx> #include <rtl/ustring.hxx> +#include <vcl/GestureEvent.hxx> class CommandExtTextInputData; class CommandWheelData; @@ -37,6 +38,8 @@ class CommandMediaData; class CommandSelectionChangeData; class CommandSwipeData; class CommandLongPressData; +class CommandGestureData; + enum class CommandEventId; enum class ExtTextInputAttr { @@ -86,6 +89,7 @@ public: const CommandSelectionChangeData* GetSelectionChangeData() const; const CommandSwipeData* GetSwipeData() const; const CommandLongPressData* GetLongPressData() const; + const CommandGestureData* GetGestureData() const; }; class VCL_DLLPUBLIC CommandExtTextInputData @@ -300,6 +304,25 @@ public: double getY() const { return mnY; } }; +class VCL_DLLPUBLIC CommandGestureData +{ +public: + double const mfX; + double const mfY; + GestureEventType const meEventType; + + double const mfOffset; + PanningOrientation const meOrientation; + + CommandGestureData(double fX, double fY, GestureEventType eEventType, double fOffset, PanningOrientation eOrientation) + : mfX(fX) + , mfY(fY) + , meEventType(eEventType) + , mfOffset(fOffset) + , meOrientation(eOrientation) + {} +}; + enum class CommandEventId { NONE = 0, @@ -323,6 +346,7 @@ enum class CommandEventId QueryCharPosition = 20, Swipe = 21, LongPress = 22, + Gesture = 23, }; #endif // INCLUDED_VCL_COMMANDEVENT_HXX diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 712f75a0f09d..d89a23e54a13 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -63,6 +63,7 @@ class WorkWindow; class NotifyEvent; class KeyEvent; class MouseEvent; +class GestureEvent; struct ImplSVEvent; struct ConvertData; @@ -747,6 +748,8 @@ public: */ static ImplSVEvent * PostMouseEvent( VclEventId nEvent, vcl::Window *pWin, MouseEvent const * pMouseEvent ); + static ImplSVEvent* PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, GestureEvent const * pGestureEvent); + /** Remove mouse and keypress events from a window... any also zoom and scroll events if the platform supports it. diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index 26cf1a681c2b..4ba071715b6a 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -170,6 +170,7 @@ enum class VclEventId WindowShow, WindowStartDocking, // pData = DockingData WindowToggleFloating, + WindowGestureEvent, }; class VCL_DLLPUBLIC VclSimpleEvent |