summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAlexander Levin <al.le@rockbox.org>2009-08-12 13:37:07 +0000
committerAlexander Levin <al.le@rockbox.org>2009-08-12 13:37:07 +0000
commit3bfc0e7a7e834ea3bf0a0e42d371b7f890e7a827 (patch)
tree22f02c9e6b165d08350837cb263c2677529243bd /apps
parente4bdc08d0c2468f5d9fa6205495788241d7e562a (diff)
downloadrockbox-3bfc0e7a7e834ea3bf0a0e42d371b7f890e7a827.zip
rockbox-3bfc0e7a7e834ea3bf0a0e42d371b7f890e7a827.tar.gz
rockbox-3bfc0e7a7e834ea3bf0a0e42d371b7f890e7a827.tar.bz2
rockbox-3bfc0e7a7e834ea3bf0a0e42d371b7f890e7a827.tar.xz
Remove unneeded symbols and improve the comment to the VP parsing function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22266 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/viewport.c8
-rw-r--r--apps/gui/viewport.h27
2 files changed, 19 insertions, 16 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index d30352a..ef527d9 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -200,7 +200,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
{
if (!(ptr = parse_list("ddddd", &set, separator, ptr,
&vp->x, &vp->y, &vp->width, &vp->height, &vp->font)))
- return VP_ERROR;
+ return NULL;
}
else
#endif
@@ -210,7 +210,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
if (!(ptr = parse_list(ARG_STRING(depth), &set, separator, ptr,
&vp->x, &vp->y, &vp->width, &vp->height, &vp->font,
&vp->fg_pattern,&vp->bg_pattern)))
- return VP_ERROR;
+ return NULL;
}
else
#undef ARG_STRING
@@ -219,7 +219,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
/* X and Y *must* be set */
if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y))
- return VP_ERROR;
+ return NULL;
/* fix defaults */
if (!LIST_VALUE_PARSED(set, PL_WIDTH))
@@ -244,7 +244,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
(vp->y >= screens[screen].lcdheight) ||
((vp->y + vp->height) > screens[screen].lcdheight))
{
- return VP_ERROR;
+ return NULL;
}
/* Default to using the user font if the font was an invalid number or '-'*/
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index f703c97..16f52eb 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -28,25 +28,28 @@
/* return the number of text lines in the vp viewport */
int viewport_get_nb_lines(struct viewport *vp);
-#define VP_ERROR 0
-#define VP_DIMENSIONS 0x1
-#define VP_COLORS 0x2
-#define VP_SELECTIONCOLORS 0x4
-/* load a viewport struct from a config string.
- returns a combination of the above to say which were loaded ok from the string */
-int viewport_load_config(const char *config, struct viewport *vp);
-
void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
-/* parse a viewport list, which looks like
- * X|Y|width|height|font|foregorund color|background color
- * | is a separator */
+/* Parse a viewport definition (vp_def), which looks like:
+ *
+ * Screens with depth > 1:
+ * X|Y|width|height|font|foregorund color|background color
+ * Screens with depth = 1:
+ * X|Y|width|height|font
+ *
+ * | is a separator and can be specified via the parameter
+ *
+ * Returns the pointer to the char after the last character parsed
+ * if everything went OK or NULL if an error happened (some values
+ * not specified in the definition)
+ */
#ifdef HAVE_LCD_BITMAP
const char* viewport_parse_viewport(struct viewport *vp,
enum screen_type screen,
- const char *bufptr,
+ const char *vp_def,
const char separator);
#endif
+
/* Used to specify which screens the statusbar (SB) should be displayed on.
*
* The parameter is a bit OR'ed combination of the following (screen is