aboutsummaryrefslogtreecommitdiff
path: root/common/util.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-26 10:49:49 -0400
committerGitHub <noreply@github.com>2018-08-26 10:49:49 -0400
commitdf7083a2d0842a3985747770774075a8f5ecdaef (patch)
tree2aad57ba7f7eec9fdb51b98859f6da826a4d39a1 /common/util.c
parent1a30c50ef40e918942f96c9a399f9bf94c1c0116 (diff)
parent5dbbab7bdc56fc513eea2f9a39d722859a3b0c2e (diff)
Merge pull request #2515 from RyanDwyer/remove-layout-file
Remove layout.c
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index 467aa4b5..561b3804 100644
--- a/common/util.c
+++ b/common/util.c
@@ -175,3 +175,24 @@ failed:
free(current);
return NULL;
}
+
+bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out) {
+ switch (dir) {
+ case MOVE_UP:
+ *out = WLR_DIRECTION_UP;
+ break;
+ case MOVE_DOWN:
+ *out = WLR_DIRECTION_DOWN;
+ break;
+ case MOVE_LEFT:
+ *out = WLR_DIRECTION_LEFT;
+ break;
+ case MOVE_RIGHT:
+ *out = WLR_DIRECTION_RIGHT;
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}