From bb618dbd84389a8625244e97c5f61addd7870810 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 28 Jul 2011 11:26:01 +0000 Subject: skin engine softlock support for touchscreens: Modify the %Tl() tag to add a new region 'lock' which will lock/unlock the wps/sbs from touches (hardware buttons still work) You can also specify a region to work when locked by prepending ^ to the action name (this is probably about to change though) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30218 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_touchsupport.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/gui/skin_engine/skin_touchsupport.c') diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index a0b82dd9da..d4f4fe226b 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c @@ -72,6 +72,12 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, regions = regions->next; continue; } + if (data->touchscreen_locked && + (r->action != ACTION_TOUCH_SOFTLOCK && !r->allow_while_locked)) + { + regions = regions->next; + continue; + } needs_repeat = r->press_length != PRESS; /* check if it's inside this viewport */ if (viewport_point_within_vp(&(r->wvp->vp), x, y)) @@ -150,6 +156,10 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, } switch (returncode) { + case ACTION_TOUCH_SOFTLOCK: + data->touchscreen_locked = !data->touchscreen_locked; + returncode = ACTION_NONE; + break; case ACTION_WPS_PLAY: if (!audio_status()) { -- cgit v1.2.3