diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index e722adf..061b170 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -205,6 +205,26 @@ int utouch_frame_set_current_slot(utouch_frame_handle fh, int slot) | |||
| 205 | return 0; | 205 | return 0; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | int utouch_frame_set_current_id(utouch_frame_handle fh, int id) | ||
| 209 | { | ||
| 210 | struct utouch_contact *t; | ||
| 211 | int i; | ||
| 212 | |||
| 213 | for (i = 0; i < fh->num_slots; i++) { | ||
| 214 | t = fh->next->slots[i]; | ||
| 215 | if (t->id == id) | ||
| 216 | return utouch_frame_set_current_slot(fh, i); | ||
| 217 | } | ||
| 218 | for (i = 0; i < fh->num_slots; i++) { | ||
| 219 | t = fh->next->slots[i]; | ||
| 220 | if (t->id < 0) { | ||
| 221 | t->id = id; | ||
| 222 | return utouch_frame_set_current_slot(fh, i); | ||
| 223 | } | ||
| 224 | } | ||
| 225 | return -ENOMEM; | ||
| 226 | } | ||
| 227 | |||
| 208 | static void transform_slot(struct utouch_contact *slot, | 228 | static void transform_slot(struct utouch_contact *slot, |
| 209 | const struct utouch_surface *s) | 229 | const struct utouch_surface *s) |
| 210 | { | 230 | { |
