summaryrefslogtreecommitdiff
path: root/src/protocols/CursorShape.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-07-21 13:09:54 +0200
committerGitHub <noreply@github.com>2024-07-21 13:09:54 +0200
commit016da234d0e852de3ef20eb2e89ac58d2a85f6e7 (patch)
tree496085987176551b0794fffc069877d44943e2f1 /src/protocols/CursorShape.cpp
parentf642fb97df5c69267a03452533de383ff8023570 (diff)
Core: Move to aquamarine (#6608)
Moves Hyprland from wlroots to aquamarine for the backend. --------- Signed-off-by: Vaxry <vaxry@vaxry.net> Co-authored-by: Mihai Fufezan <mihai@fufexan.net> Co-authored-by: Jan Beich <jbeich@FreeBSD.org> Co-authored-by: vaxerski <vaxerski@users.noreply.github.com> Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com> Co-authored-by: Tom Englund <tomenglund26@gmail.com> Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com> Co-authored-by: diniamo <diniamo53@gmail.com>
Diffstat (limited to 'src/protocols/CursorShape.cpp')
-rw-r--r--src/protocols/CursorShape.cpp45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/protocols/CursorShape.cpp b/src/protocols/CursorShape.cpp
index 2f25b22b..812afe53 100644
--- a/src/protocols/CursorShape.cpp
+++ b/src/protocols/CursorShape.cpp
@@ -1,48 +1,9 @@
#include "CursorShape.hpp"
#include <algorithm>
+#include "../helpers/CursorShapes.hpp"
#define LOGM PROTO::cursorShape->protoLog
-// clang-format off
-constexpr const char* SHAPE_NAMES[] = {
- "invalid",
- "default",
- "context-menu",
- "help",
- "pointer",
- "progress",
- "wait",
- "cell",
- "crosshair",
- "text",
- "vertical-text",
- "alias",
- "copy",
- "move",
- "no-drop",
- "not-allowed",
- "grab",
- "grabbing",
- "e-resize",
- "n-resize",
- "ne-resize",
- "nw-resize",
- "s-resize",
- "se-resize",
- "sw-resize",
- "w-resize",
- "ew-resize",
- "ns-resize",
- "nesw-resize",
- "nwse-resize",
- "col-resize",
- "row-resize",
- "all-scroll",
- "zoom-in",
- "zoom-out",
-};
-// clang-format on
-
CCursorShapeProtocol::CCursorShapeProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
;
}
@@ -82,7 +43,7 @@ void CCursorShapeProtocol::createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr
}
void CCursorShapeProtocol::onSetShape(CWpCursorShapeDeviceV1* pMgr, uint32_t serial, wpCursorShapeDeviceV1Shape shape) {
- if ((uint32_t)shape == 0 || (uint32_t)shape > sizeof(SHAPE_NAMES)) {
+ if ((uint32_t)shape == 0 || (uint32_t)shape > CURSOR_SHAPE_NAMES.size()) {
pMgr->error(WP_CURSOR_SHAPE_DEVICE_V1_ERROR_INVALID_SHAPE, "The shape is invalid");
return;
}
@@ -90,7 +51,7 @@ void CCursorShapeProtocol::onSetShape(CWpCursorShapeDeviceV1* pMgr, uint32_t ser
SSetShapeEvent event;
event.pMgr = pMgr;
event.shape = shape;
- event.shapeName = SHAPE_NAMES[shape];
+ event.shapeName = CURSOR_SHAPE_NAMES.at(shape);
events.setShape.emit(event);
} \ No newline at end of file