diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-05-14 01:15:14 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-05-14 01:41:39 +0200 |
commit | 8ced3667a30e00bd2368d4b5417f1f07cc86d290 (patch) | |
tree | 57137593f90a29c5ac9039fc1aebcde1158f01cb /src/capabilities.c | |
parent | ebaf307ab1b22d4786cc5fb55170204759e887ce (diff) |
Add convenience methods for distance to capability center point
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/capabilities.c')
-rw-r--r-- | src/capabilities.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/capabilities.c b/src/capabilities.c index 9879ddf..cd96e8e 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -128,6 +128,16 @@ int get_cap_wsize(const struct Capabilities *cap) return cap->abs_touch_major.maximum - cap->abs_touch_major.minimum; } +int get_cap_xmid(const struct Capabilities *cap) +{ + return (cap->abs_position_x.maximum + cap->abs_position_x.minimum) >> 1; +} + +int get_cap_ymid(const struct Capabilities *cap) +{ + return (cap->abs_position_y.maximum + cap->abs_position_y.minimum) >> 1; +} + void output_capabilities(const struct Capabilities *cap) { char line[1024]; |