diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-07-28 11:26:01 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-07-28 11:26:01 +0000 |
commit | bb618dbd84389a8625244e97c5f61addd7870810 (patch) | |
tree | bffbb1d02597b1a732429c0fbbdcf1173dc60d87 /apps/gui/skin_engine/skin_touchsupport.c | |
parent | b9f32302736031725a3885db2612b14af69c4dd5 (diff) | |
download | rockbox-bb618dbd84389a8625244e97c5f61addd7870810.tar.gz rockbox-bb618dbd84389a8625244e97c5f61addd7870810.zip |
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
Diffstat (limited to 'apps/gui/skin_engine/skin_touchsupport.c')
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 10 |
1 files changed, 10 insertions, 0 deletions
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, | |||
72 | regions = regions->next; | 72 | regions = regions->next; |
73 | continue; | 73 | continue; |
74 | } | 74 | } |
75 | if (data->touchscreen_locked && | ||
76 | (r->action != ACTION_TOUCH_SOFTLOCK && !r->allow_while_locked)) | ||
77 | { | ||
78 | regions = regions->next; | ||
79 | continue; | ||
80 | } | ||
75 | needs_repeat = r->press_length != PRESS; | 81 | needs_repeat = r->press_length != PRESS; |
76 | /* check if it's inside this viewport */ | 82 | /* check if it's inside this viewport */ |
77 | if (viewport_point_within_vp(&(r->wvp->vp), x, y)) | 83 | 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, | |||
150 | } | 156 | } |
151 | switch (returncode) | 157 | switch (returncode) |
152 | { | 158 | { |
159 | case ACTION_TOUCH_SOFTLOCK: | ||
160 | data->touchscreen_locked = !data->touchscreen_locked; | ||
161 | returncode = ACTION_NONE; | ||
162 | break; | ||
153 | case ACTION_WPS_PLAY: | 163 | case ACTION_WPS_PLAY: |
154 | if (!audio_status()) | 164 | if (!audio_status()) |
155 | { | 165 | { |