aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-10 12:32:45 -0500
committerDavid Robillard <d@drobilla.net>2023-01-10 12:32:45 -0500
commite554f8c5ea5f812e7e0ce7d5c99129370c4c595a (patch)
treec3abf0307492acaae54dd52bae0f72d708a3b3ce
parentbc7ce5e77224f276a97593b2d1c9f888dc63d1dc (diff)
downloadpugl-e554f8c5ea5f812e7e0ce7d5c99129370c4c595a.tar.gz
pugl-e554f8c5ea5f812e7e0ce7d5c99129370c4c595a.tar.bz2
pugl-e554f8c5ea5f812e7e0ce7d5c99129370c4c595a.zip
Add PUGL_CURSOR_ALL_SCROLL
-rw-r--r--bindings/cpp/include/pugl/pugl.hpp4
-rw-r--r--examples/pugl_cursor_demo.c2
-rw-r--r--include/pugl/pugl.h3
-rw-r--r--src/mac.m2
-rw-r--r--src/win.c1
-rw-r--r--src/x11.c1
6 files changed, 9 insertions, 4 deletions
diff --git a/bindings/cpp/include/pugl/pugl.hpp b/bindings/cpp/include/pugl/pugl.hpp
index bea4deb..2119bda 100644
--- a/bindings/cpp/include/pugl/pugl.hpp
+++ b/bindings/cpp/include/pugl/pugl.hpp
@@ -378,10 +378,10 @@ enum class Cursor {
upDown, ///< @copydoc PUGL_CURSOR_UP_DOWN
upLeftDownRight, ///< @copydoc PUGL_CURSOR_UP_LEFT_DOWN_RIGHT
upRightDownLeft, ///< @copydoc PUGL_CURSOR_UP_RIGHT_DOWN_LEFT
+ allScroll, ///< @copydoc PUGL_CURSOR_ALL_SCROLL
};
-static_assert(static_cast<Cursor>(PUGL_CURSOR_UP_RIGHT_DOWN_LEFT) ==
- Cursor::upRightDownLeft,
+static_assert(static_cast<Cursor>(PUGL_CURSOR_ALL_SCROLL) == Cursor::allScroll,
"");
/// @copydoc PuglShowCommand
diff --git a/examples/pugl_cursor_demo.c b/examples/pugl_cursor_demo.c
index c4a4e8d..230bf08 100644
--- a/examples/pugl_cursor_demo.c
+++ b/examples/pugl_cursor_demo.c
@@ -8,7 +8,7 @@
#include <stdbool.h>
-static const int N_CURSORS = 9;
+static const int N_CURSORS = 10;
static const int N_ROWS = 2;
static const int N_COLS = 5;
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h
index ea2f3a9..dbe40df 100644
--- a/include/pugl/pugl.h
+++ b/include/pugl/pugl.h
@@ -1371,10 +1371,11 @@ typedef enum {
PUGL_CURSOR_UP_DOWN, ///< Up/down arrow for vertical resize
PUGL_CURSOR_UP_LEFT_DOWN_RIGHT, ///< Diagonal arrow for down/right resize
PUGL_CURSOR_UP_RIGHT_DOWN_LEFT, ///< Diagonal arrow for down/left resize
+ PUGL_CURSOR_ALL_SCROLL, ///< Omnidirectional "arrow" for scrolling
} PuglCursor;
/// The number of #PuglCursor values
-#define PUGL_NUM_CURSORS ((unsigned)PUGL_CURSOR_UP_RIGHT_DOWN_LEFT + 1U)
+#define PUGL_NUM_CURSORS ((unsigned)PUGL_CURSOR_ALL_SCROLL + 1U)
/**
Grab the keyboard input focus.
diff --git a/src/mac.m b/src/mac.m
index 3b0896c..841a154 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1916,6 +1916,8 @@ puglGetNsCursor(const PuglCursor cursor)
return extendedCursor(@selector(_windowResizeNorthWestSouthEastCursor));
case PUGL_CURSOR_UP_RIGHT_DOWN_LEFT:
return extendedCursor(@selector(_windowResizeNorthEastSouthWestCursor));
+ case PUGL_CURSOR_ALL_SCROLL:
+ return [NSCursor closedHandCursor];
}
return NULL;
diff --git a/src/win.c b/src/win.c
index fa50034..d3bc4fd 100644
--- a/src/win.c
+++ b/src/win.c
@@ -1447,6 +1447,7 @@ static const char* const cursor_ids[] = {
IDC_SIZENS, // UP_DOWN
IDC_SIZENWSE, // UP_LEFT_DOWN_RIGHT
IDC_SIZENESW, // UP_RIGHT_DOWN_LEFT
+ IDC_SIZEALL, // ALL_SCROLL
};
PuglStatus
diff --git a/src/x11.c b/src/x11.c
index bb2e41f..ff7996a 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -78,6 +78,7 @@ static const char* const cursorNames[PUGL_NUM_CURSORS] = {
"sb_v_double_arrow", // UP_DOWN
"size_fdiag", // UP_LEFT_DOWN_RIGHT
"size_bdiag", // UP_RIGHT_DOWN_LEFT
+ "all-scroll", // ALL_SCROLL
};
#endif