aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-08 06:08:06 -0500
committerTony Crisci <tony@dubstepdish.com>2017-12-08 06:08:06 -0500
commit4c60072be584a7ed5b97de325994217a9e96bbd4 (patch)
tree96bf5e33d9c5d95842ba7813f5e37c28693d52ae
parent31bafc24614cb5a66348ca965f1b4fae9209e35c (diff)
move get_resize_name to xcursor
-rw-r--r--include/wlr/types/wlr_xcursor_manager.h7
-rw-r--r--include/wlr/xcursor.h6
-rw-r--r--rootston/seat.c2
-rw-r--r--types/wlr_xcursor_manager.c23
-rw-r--r--xcursor/wlr_xcursor.c23
5 files changed, 30 insertions, 31 deletions
diff --git a/include/wlr/types/wlr_xcursor_manager.h b/include/wlr/types/wlr_xcursor_manager.h
index 63eb5386..c78a6e8d 100644
--- a/include/wlr/types/wlr_xcursor_manager.h
+++ b/include/wlr/types/wlr_xcursor_manager.h
@@ -4,7 +4,6 @@
#include <wayland-server.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/xcursor.h>
-#include <wlr/util/edges.h>
/**
* A scaled XCursor theme.
@@ -51,10 +50,4 @@ struct wlr_xcursor *wlr_xcursor_manager_get_xcursor(
void wlr_xcursor_manager_set_cursor_image(struct wlr_xcursor_manager *manager,
const char *name, struct wlr_cursor *cursor);
-/**
- * Get the name of the cursor image for the given edges.
- */
-const char *wlr_xcursor_manager_get_resize_name(enum wlr_edges edges);
-
-
#endif
diff --git a/include/wlr/xcursor.h b/include/wlr/xcursor.h
index b6362b06..42fcedb9 100644
--- a/include/wlr/xcursor.h
+++ b/include/wlr/xcursor.h
@@ -32,6 +32,7 @@
#define WLR_XCURSOR_H
#include <stdint.h>
+#include <wlr/util/edges.h>
struct wlr_xcursor_image {
uint32_t width; /* actual width */
@@ -65,4 +66,9 @@ struct wlr_xcursor *wlr_xcursor_theme_get_cursor(
int wlr_xcursor_frame(struct wlr_xcursor *cursor, uint32_t time);
+/**
+ * Get the name of the resize cursor image for the given edges.
+ */
+const char *wlr_xcursor_get_resize_name(enum wlr_edges edges);
+
#endif
diff --git a/rootston/seat.c b/rootston/seat.c
index f6473581..1fa09ad6 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -661,7 +661,7 @@ void roots_seat_begin_resize(struct roots_seat *seat, struct roots_view *view,
view_maximize(view, false);
wlr_seat_pointer_clear_focus(seat->seat);
- const char *resize_name = wlr_xcursor_manager_get_resize_name(edges);
+ const char *resize_name = wlr_xcursor_get_resize_name(edges);
wlr_xcursor_manager_set_cursor_image(seat->cursor->xcursor_manager,
resize_name, seat->cursor->cursor);
}
diff --git a/types/wlr_xcursor_manager.c b/types/wlr_xcursor_manager.c
index 9350d721..f32a96bc 100644
--- a/types/wlr_xcursor_manager.c
+++ b/types/wlr_xcursor_manager.c
@@ -82,26 +82,3 @@ void wlr_xcursor_manager_set_cursor_image(struct wlr_xcursor_manager *manager,
theme->scale);
}
}
-
-const char *wlr_xcursor_manager_get_resize_name(enum wlr_edges edges) {
- if (edges & WLR_EDGE_TOP) {
- if (edges & WLR_EDGE_RIGHT) {
- return "ne-resize";
- } else if (edges & WLR_EDGE_LEFT) {
- return "nw-resize";
- }
- return "n-resize";
- } else if (edges & WLR_EDGE_BOTTOM) {
- if (edges & WLR_EDGE_RIGHT) {
- return "se-resize";
- } else if (edges & WLR_EDGE_LEFT) {
- return "sw-resize";
- }
- return "s-resize";
- } else if (edges & WLR_EDGE_RIGHT) {
- return "e-resize";
- } else if (edges & WLR_EDGE_LEFT) {
- return "w-resize";
- }
- return "se-resize"; // fallback
-}
diff --git a/xcursor/wlr_xcursor.c b/xcursor/wlr_xcursor.c
index fdebe1af..b1678223 100644
--- a/xcursor/wlr_xcursor.c
+++ b/xcursor/wlr_xcursor.c
@@ -326,3 +326,26 @@ static int wlr_xcursor_frame_and_duration(struct wlr_xcursor *cursor,
int wlr_xcursor_frame(struct wlr_xcursor *_cursor, uint32_t time) {
return wlr_xcursor_frame_and_duration(_cursor, time, NULL);
}
+
+const char *wlr_xcursor_get_resize_name(enum wlr_edges edges) {
+ if (edges & WLR_EDGE_TOP) {
+ if (edges & WLR_EDGE_RIGHT) {
+ return "ne-resize";
+ } else if (edges & WLR_EDGE_LEFT) {
+ return "nw-resize";
+ }
+ return "n-resize";
+ } else if (edges & WLR_EDGE_BOTTOM) {
+ if (edges & WLR_EDGE_RIGHT) {
+ return "se-resize";
+ } else if (edges & WLR_EDGE_LEFT) {
+ return "sw-resize";
+ }
+ return "s-resize";
+ } else if (edges & WLR_EDGE_RIGHT) {
+ return "e-resize";
+ } else if (edges & WLR_EDGE_LEFT) {
+ return "w-resize";
+ }
+ return "se-resize"; // fallback
+}