aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-05 15:01:12 +0200
committerDavid Robillard <d@drobilla.net>2020-07-05 18:47:37 +0200
commit6c2460414082b989487abcad2ca2018a16ecdbd7 (patch)
treee1b2f29a01098b16483bf744088aca202f903ea0 /pugl/pugl.h
parent7d45962ccd6fabcb198599fead141de7cd578916 (diff)
downloadpugl-6c2460414082b989487abcad2ca2018a16ecdbd7.tar.gz
pugl-6c2460414082b989487abcad2ca2018a16ecdbd7.tar.bz2
pugl-6c2460414082b989487abcad2ca2018a16ecdbd7.zip
Add scroll direction field
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 137e6d1..8c0bd6d 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -239,6 +239,22 @@ typedef enum {
} PuglCrossingMode;
/**
+ Scroll direction.
+
+ Describes the direction of a #PuglEventScroll along with whether the scroll
+ is a "smooth" scroll. The discrete directions are for devices like mouse
+ wheels with constrained axes, while a smooth scroll is for those with
+ arbitrary scroll direction freedom, like some touchpads.
+*/
+typedef enum {
+ PUGL_SCROLL_UP, ///< Scroll up
+ PUGL_SCROLL_DOWN, ///< Scroll down
+ PUGL_SCROLL_LEFT, ///< Scroll left
+ PUGL_SCROLL_RIGHT, ///< Scroll right
+ PUGL_SCROLL_SMOOTH ///< Smooth scroll in any direction
+} PuglScrollDirection;
+
+/**
Common header for all event structs.
*/
typedef struct {
@@ -471,16 +487,17 @@ typedef struct {
gracefully.
*/
typedef struct {
- PuglEventType type; ///< #PUGL_SCROLL
- PuglEventFlags flags; ///< Bitwise OR of #PuglEventFlag values
- double time; ///< Time in seconds
- double x; ///< View-relative X coordinate
- double y; ///< View-relative Y coordinate
- double xRoot; ///< Root-relative X coordinate
- double yRoot; ///< Root-relative Y coordinate
- PuglMods state; ///< Bitwise OR of #PuglMod flags
- double dx; ///< Scroll X distance in lines
- double dy; ///< Scroll Y distance in lines
+ PuglEventType type; ///< #PUGL_SCROLL
+ PuglEventFlags flags; ///< Bitwise OR of #PuglEventFlag values
+ double time; ///< Time in seconds
+ double x; ///< View-relative X coordinate
+ double y; ///< View-relative Y coordinate
+ double xRoot; ///< Root-relative X coordinate
+ double yRoot; ///< Root-relative Y coordinate
+ PuglMods state; ///< Bitwise OR of #PuglMod flags
+ PuglScrollDirection direction; ///< Scroll direction
+ double dx; ///< Scroll X distance in lines
+ double dy; ///< Scroll Y distance in lines
} PuglEventScroll;
/**