summaryrefslogtreecommitdiffstats
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.tar.bz2
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 @@
#include "config.h"
+#include "action.h"
#include "system.h"
#include "settings.h"
#include "appevents.h"
@@ -253,3 +254,36 @@ void sb_skin_init(void)
sb_skin[i].sync_data = &sb_skin_sync_data;
}
}
+
+#ifdef HAVE_TOUCHSCREEN
+static bool bypass_sb_touchregions = true;
+void sb_bypass_touchregions(bool enable)
+{
+ bypass_sb_touchregions = enable;
+}
+
+int sb_touch_to_button(int context)
+{
+ static int last_context = -1;
+ int button, offset;
+ if (bypass_sb_touchregions)
+ return ACTION_TOUCHSCREEN;
+
+ if (last_context != context)
+ skin_disarm_touchregions(&sb_skin_data[SCREEN_MAIN]);
+ last_context = context;
+ button = skin_get_touchaction(&sb_skin_data[SCREEN_MAIN], &offset);
+
+ switch (button)
+ {
+#ifdef HAVE_VOLUME_IN_LIST
+ case ACTION_WPS_VOLUP:
+ return ACTION_LIST_VOLUP;
+ case ACTION_WPS_VOLDOWN:
+ return ACTION_LIST_VOLDOWN;
+#endif
+ /* TODO */
+ }
+ return button;
+}
+#endif