summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-23 21:07:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-26 09:14:00 +0000
commit903a420609252aff12d9481b5fd8cc8d1f1d445f (patch)
tree1b5266949021523603134c793ae4f1d286980618 /include/vcl
parent82f4f6b19febb607d8823923380777f27e0ab3d9 (diff)
add GtkSwipeGesture support and implement swipe left/right to change slides
keep it simple for now. deliver to the same target window that gets the MouseWheel events, maybe worth combining MouseWheel and Gestures into the same thing and use it in slideshows so swipe toward the left to advance to the next slide, to the right to return to the previous slide. swipes are followed by mouse up events, impress already has a similar hack to hide an mouse-up from the (incredibly complicated) interaction with the slideshow so simply use that Change-Id: Ib34f6fa0f15f3aa34eef887eb9d5642de9e5cdd1
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/cmdevt.hxx30
1 files changed, 27 insertions, 3 deletions
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx
index 6e85c1ef8360..8e62e256fa73 100644
--- a/include/vcl/cmdevt.hxx
+++ b/include/vcl/cmdevt.hxx
@@ -336,10 +336,26 @@ inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
mnEnd = nEnd;
}
+class VCL_DLLPUBLIC CommandSwipeData
+{
+ double mnVelocityX;
+ double mnVelocityY;
+public:
+ CommandSwipeData()
+ : mnVelocityX(0)
+ , mnVelocityY(0)
+ {
+ }
+ CommandSwipeData(double nVelocityX, double nVelocityY)
+ : mnVelocityX(nVelocityX)
+ , mnVelocityY(nVelocityY)
+ {
+ }
+ double getVelocityX() const { return mnVelocityX; }
+ double getVelocityY() const { return mnVelocityY; }
+};
// - CommandEvent -
-
-
#define COMMAND_CONTEXTMENU ((sal_uInt16)1)
#define COMMAND_STARTDRAG ((sal_uInt16)2)
#define COMMAND_WHEEL ((sal_uInt16)3)
@@ -359,7 +375,7 @@ inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
#define COMMAND_SELECTIONCHANGE ((sal_uInt16)18)
#define COMMAND_PREPARERECONVERSION ((sal_uInt16)19)
#define COMMAND_QUERYCHARPOSITION ((sal_uInt16)20)
-
+#define COMMAND_SWIPE ((sal_uInt16)21)
class VCL_DLLPUBLIC CommandEvent
{
@@ -387,6 +403,7 @@ public:
const CommandDialogData* GetDialogData() const;
CommandMediaData* GetMediaData() const;
const CommandSelectionChangeData* GetSelectionChangeData() const;
+ const CommandSwipeData* GetSwipeData() const;
};
inline CommandEvent::CommandEvent()
@@ -469,6 +486,13 @@ inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData()
return NULL;
}
+inline const CommandSwipeData* CommandEvent::GetSwipeData() const
+{
+ if( mnCommand == COMMAND_SWIPE )
+ return (const CommandSwipeData*)(mpData);
+ else
+ return NULL;
+}
#endif // INCLUDED_VCL_CMDEVT_HXX