summaryrefslogtreecommitdiff
path: root/apps/gui/statusbar-skinned.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-21 06:04:19 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-21 06:04:19 +0000
commita398c2846aa86650aa386a68cb51929477b6aa23 (patch)
tree4fa695ba8ea3a2b0e0c1f1c1ab5ac9ce27430804 /apps/gui/statusbar-skinned.c
parent2b0ef19900295ef4e8da0fa52a13a04ccf76cb65 (diff)
downloadrockbox-a398c2846aa86650aa386a68cb51929477b6aa23.tar.gz
rockbox-a398c2846aa86650aa386a68cb51929477b6aa23.zip
Touchregion support for the Base Skin and FM Skins. display obviously needs to be in stylus mode for this to work. Just about all screens should be mostly useable if your sbs has the next/prev/select/cancel/menu regions defined.
Plenty of room to add new action abilities if they are wanted. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27004 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r--apps/gui/statusbar-skinned.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index fcd4cfbd9e..168b17fa38 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -21,6 +21,7 @@
21 21
22#include "config.h" 22#include "config.h"
23 23
24#include "action.h"
24#include "system.h" 25#include "system.h"
25#include "settings.h" 26#include "settings.h"
26#include "appevents.h" 27#include "appevents.h"
@@ -253,3 +254,36 @@ void sb_skin_init(void)
253 sb_skin[i].sync_data = &sb_skin_sync_data; 254 sb_skin[i].sync_data = &sb_skin_sync_data;
254 } 255 }
255} 256}
257
258#ifdef HAVE_TOUCHSCREEN
259static bool bypass_sb_touchregions = true;
260void sb_bypass_touchregions(bool enable)
261{
262 bypass_sb_touchregions = enable;
263}
264
265int sb_touch_to_button(int context)
266{
267 static int last_context = -1;
268 int button, offset;
269 if (bypass_sb_touchregions)
270 return ACTION_TOUCHSCREEN;
271
272 if (last_context != context)
273 skin_disarm_touchregions(&sb_skin_data[SCREEN_MAIN]);
274 last_context = context;
275 button = skin_get_touchaction(&sb_skin_data[SCREEN_MAIN], &offset);
276
277 switch (button)
278 {
279#ifdef HAVE_VOLUME_IN_LIST
280 case ACTION_WPS_VOLUP:
281 return ACTION_LIST_VOLUP;
282 case ACTION_WPS_VOLDOWN:
283 return ACTION_LIST_VOLDOWN;
284#endif
285 /* TODO */
286 }
287 return button;
288}
289#endif