summaryrefslogtreecommitdiffstats
path: root/apps/gui/statusbar-skinned.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-11-15 14:11:08 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-11-15 14:11:08 +0000
commit9e07ef2b0adb8fca7e5a9e516397e533653f8836 (patch)
tree0a283550421917e52ee04068b84a464976f0c4f2 /apps/gui/statusbar-skinned.c
parent101693fd3047fb64e766580e80635a424fa25c4d (diff)
downloadrockbox-9e07ef2b0adb8fca7e5a9e516397e533653f8836.tar.gz
rockbox-9e07ef2b0adb8fca7e5a9e516397e533653f8836.tar.bz2
rockbox-9e07ef2b0adb8fca7e5a9e516397e533653f8836.zip
Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs. This removes all skin memory limitations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r--apps/gui/statusbar-skinned.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index f79672c0d9..960cf67d4d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -87,8 +87,9 @@ int sb_postproccess(enum screen_type screen, struct wps_data *data)
/* hide the sb's default viewport because it has nasty effect with stuff
* not part of the statusbar,
* hence .sbs's without any other vps are unsupported*/
- struct skin_viewport *vp = skin_find_item(VP_DEFAULT_LABEL, SKIN_FIND_VP, data);
- struct skin_element *next_vp = data->tree->next;
+ struct skin_viewport *vp = skin_find_item(VP_DEFAULT_LABEL_STRING, SKIN_FIND_VP, data);
+ struct skin_element *tree = SKINOFFSETTOPTR(get_skin_buffer(data), data->tree);
+ struct skin_element *next_vp = SKINOFFSETTOPTR(get_skin_buffer(data), tree->next);
if (vp)
{
@@ -105,9 +106,9 @@ int sb_postproccess(enum screen_type screen, struct wps_data *data)
return 1;
}
-static char *infovp_label[NB_SCREENS];
-static char *oldinfovp_label[NB_SCREENS];
-void sb_set_info_vp(enum screen_type screen, char *label)
+static OFFSETTYPE(char*) infovp_label[NB_SCREENS];
+static OFFSETTYPE(char*) oldinfovp_label[NB_SCREENS];
+void sb_set_info_vp(enum screen_type screen, OFFSETTYPE(char*) label)
{
infovp_label[screen] = label;
}
@@ -116,15 +117,19 @@ struct viewport *sb_skin_get_info_vp(enum screen_type screen)
{
struct wps_data *data = skin_get_gwps(CUSTOM_STATUSBAR, screen)->data;
struct skin_viewport *vp = NULL;
+ char *label;
if (oldinfovp_label[screen] &&
- strcmp(oldinfovp_label[screen], infovp_label[screen]))
+ (oldinfovp_label[screen] != infovp_label[screen]))
{
/* UI viewport changed, so force a redraw */
oldinfovp_label[screen] = infovp_label[screen];
viewportmanager_theme_enable(screen, false, NULL);
viewportmanager_theme_undo(screen, true);
}
- vp = skin_find_item(infovp_label[screen], SKIN_FIND_UIVP, data);
+ label = SKINOFFSETTOPTR(get_skin_buffer(data), infovp_label[screen]);
+ if (infovp_label[screen] == VP_DEFAULT_LABEL)
+ label = VP_DEFAULT_LABEL_STRING;
+ vp = skin_find_item(label, SKIN_FIND_UIVP, data);
if (!vp)
return NULL;
if (vp->parsed_fontid == 1)
@@ -270,7 +275,7 @@ void sb_skin_init(void)
{
FOR_NB_SCREENS(i)
{
- oldinfovp_label[i] = NULL;
+ oldinfovp_label[i] = VP_DEFAULT_LABEL;
}
}