diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-15 20:24:14 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:28:08 +0200 |
| commit | 78085b21f2dc7b1d49a0c54ab56b567fc195d440 (patch) | |
| tree | 3ae649c25b380114ce2eaa5463350fb9b29ee78c /src/hwstate.c | |
| parent | 4583da1ad81b59b2a8cd2ae51c32b1bc8d32f1c4 (diff) | |
refactor: Simplify capabilities
Use the generated abs2mt mapping to simplify the MT device
capabilities.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/hwstate.c')
| -rw-r--r-- | src/hwstate.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/hwstate.c b/src/hwstate.c index 81f4b8b..032351c 100644 --- a/src/hwstate.c +++ b/src/hwstate.c | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | #include "hwstate.h" | 22 | #include "hwstate.h" |
| 23 | 23 | ||
| 24 | #define NOTOUCH(hw, c) ((hw)->touch_major == 0 && (c)->has_touch_major) | 24 | #define NOTOUCH(hw, c) ((hw)->touch_major == 0 && (c)->has_abs[BIT_TOUCH_MAJOR]) |
| 25 | 25 | ||
| 26 | void init_hwstate(struct HWState *s) | 26 | void init_hwstate(struct HWState *s) |
| 27 | { | 27 | { |
| @@ -49,12 +49,12 @@ static void set_finger(struct FingerState *fs, | |||
| 49 | const struct FingerData *hw, int id, | 49 | const struct FingerData *hw, int id, |
| 50 | const struct Capabilities *caps) | 50 | const struct Capabilities *caps) |
| 51 | { | 51 | { |
| 52 | int x = defuzz(hw->position_x, fs->hw.position_x, caps->xfuzz); | 52 | int x = defuzz(hw->position_x, fs->hw.position_x, caps->abs[BIT_POSITION_X].fuzz); |
| 53 | int y = defuzz(hw->position_y, fs->hw.position_y, caps->yfuzz); | 53 | int y = defuzz(hw->position_y, fs->hw.position_y, caps->abs[BIT_POSITION_Y].fuzz); |
| 54 | int tj = defuzz(hw->touch_major, fs->hw.touch_major, caps->wfuzz); | 54 | int tj = defuzz(hw->touch_major, fs->hw.touch_major, caps->abs[BIT_TOUCH_MAJOR].fuzz); |
| 55 | int tn = defuzz(hw->touch_minor, fs->hw.touch_minor, caps->wfuzz); | 55 | int tn = defuzz(hw->touch_minor, fs->hw.touch_minor, caps->abs[BIT_TOUCH_MAJOR].fuzz); |
| 56 | int wj = defuzz(hw->width_major, fs->hw.width_major, caps->wfuzz); | 56 | int wj = defuzz(hw->width_major, fs->hw.width_major, caps->abs[BIT_TOUCH_MAJOR].fuzz); |
| 57 | int wn = defuzz(hw->width_minor, fs->hw.width_minor, caps->wfuzz); | 57 | int wn = defuzz(hw->width_minor, fs->hw.width_minor, caps->abs[BIT_TOUCH_MAJOR].fuzz); |
| 58 | fs->id = id; | 58 | fs->id = id; |
| 59 | fs->hw = *hw; | 59 | fs->hw = *hw; |
| 60 | fs->hw.position_x = x; | 60 | fs->hw.position_x = x; |
| @@ -65,9 +65,9 @@ static void set_finger(struct FingerState *fs, | |||
| 65 | } | 65 | } |
| 66 | fs->hw.width_major = wj; | 66 | fs->hw.width_major = wj; |
| 67 | fs->hw.width_minor = wn; | 67 | fs->hw.width_minor = wn; |
| 68 | if (!caps->has_touch_minor) | 68 | if (!caps->has_abs[BIT_TOUCH_MINOR]) |
| 69 | fs->hw.touch_minor = hw->touch_major; | 69 | fs->hw.touch_minor = hw->touch_major; |
| 70 | if (!caps->has_width_minor) | 70 | if (!caps->has_abs[BIT_WIDTH_MINOR]) |
| 71 | fs->hw.width_minor = hw->width_major; | 71 | fs->hw.width_minor = hw->width_major; |
| 72 | } | 72 | } |
| 73 | 73 | ||
