summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/util.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index 7f47d713..c80da1cb 100644
--- a/include/util.h
+++ b/include/util.h
@@ -5,6 +5,30 @@
5#include <stdbool.h> 5#include <stdbool.h>
6#include <wayland-server-protocol.h> 6#include <wayland-server-protocol.h>
7 7
8enum movement_unit {
9 MOVEMENT_UNIT_PX,
10 MOVEMENT_UNIT_PPT,
11 MOVEMENT_UNIT_DEFAULT,
12 MOVEMENT_UNIT_INVALID,
13};
14
15struct movement_amount {
16 int amount;
17 enum movement_unit unit;
18};
19
20/*
21 * Parse units such as "px" or "ppt"
22 */
23enum movement_unit parse_movement_unit(const char *unit);
24
25/*
26 * Parse arguments such as "10", "10px" or "10 px".
27 * Returns the number of arguments consumed.
28 */
29int parse_movement_amount(int argc, char **argv,
30 struct movement_amount *amount);
31
8/** 32/**
9 * Get the current time, in milliseconds. 33 * Get the current time, in milliseconds.
10 */ 34 */