From aba5c47dd6369a3612be4165a16054ebd6d74af3 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 27 Jan 2012 00:12:03 +0100 Subject: pluginlib_touchscreen: Rework API to offer wait-for-button APIs. The old touchscreen_get() needed an external button_get() call. Now two APIs are added that do this call internally. This way they behave similar to get_action. The old API is preserved (but renamed) since it's used in reversi. Change-Id: I24902c64a357f2fdd7d0c2f5371cbfd20f34f1c8 --- apps/plugins/lib/pluginlib_touchscreen.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/plugins/lib/pluginlib_touchscreen.h') diff --git a/apps/plugins/lib/pluginlib_touchscreen.h b/apps/plugins/lib/pluginlib_touchscreen.h index f2787655ee..dbd944c040 100644 --- a/apps/plugins/lib/pluginlib_touchscreen.h +++ b/apps/plugins/lib/pluginlib_touchscreen.h @@ -40,8 +40,13 @@ struct touchbutton { fb_data *pixmap; /* Currently unused, but will allow for a graphic */ }; -/* Get: tests for a button press and returns action. */ -int touchbutton_get(struct touchbutton *data, int button, int num_buttons); +/* Check: tests if the result of button_get() beloned to a touch button */ +int touchbutton_check_button(int button, struct touchbutton *data, int num_buttons); +/* Wait: Wait for input and return the corresponding action */ +int touchbutton_get(struct touchbutton *data, int num_buttons); +/* Wait with timeout */ +int touchbutton_get_w_tmo(int timeout, struct touchbutton *data, int num_buttons); + /* Draw: Draws all visible buttons */ void touchbutton_draw(struct touchbutton *data, int num_buttons); -- cgit v1.2.3