summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-03-21 19:38:00 +0000
committerDave Chapman <dave@dchapman.com>2008-03-21 19:38:00 +0000
commitd02c79c03fed154e8cdf4cbef8670221dfe922aa (patch)
treeae519730d242d0b9daadcf9daa10154beab682d5 /apps/gui/gwps.h
parent1544b36966c692e20d711b920eade06487996eb6 (diff)
downloadrockbox-d02c79c03fed154e8cdf4cbef8670221dfe922aa.zip
rockbox-d02c79c03fed154e8cdf4cbef8670221dfe922aa.tar.gz
rockbox-d02c79c03fed154e8cdf4cbef8670221dfe922aa.tar.bz2
rockbox-d02c79c03fed154e8cdf4cbef8670221dfe922aa.tar.xz
Commit viewports-in-WPS patch (FS#8385). This adds the %V tag - see the CustomWPS page for details (shortly...). There is still some work to do - decide how to handle font references, decide how to handle conditionals. Plus checkwps is broken - I'll fix that in a separate commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16733 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/gwps.h')
-rw-r--r--apps/gui/gwps.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 70f4c56..d31471c 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -61,6 +61,7 @@
#ifdef HAVE_LCD_BITMAP
struct gui_img{
struct bitmap bm;
+ struct viewport* vp; /* The viewport to display this image in */
int x; /* x-pos */
int y; /* y-pos */
bool loaded; /* load state */
@@ -86,6 +87,7 @@ struct align_pos {
#define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \
+ (2*LCD_HEIGHT*LCD_WIDTH/8))
+#define WPS_MAX_VIEWPORTS 16
#define WPS_MAX_LINES (LCD_HEIGHT/5+1)
#define WPS_MAX_SUBLINES (WPS_MAX_LINES*3)
#define WPS_MAX_TOKENS 1024
@@ -95,6 +97,7 @@ struct align_pos {
#else
+#define WPS_MAX_VIEWPORTS 2
#define WPS_MAX_LINES 2
#define WPS_MAX_SUBLINES 12
#define WPS_MAX_TOKENS 64
@@ -315,6 +318,14 @@ struct wps_line {
long subline_expire_time;
};
+struct wps_viewport {
+ struct viewport vp; /* The LCD viewport struct */
+
+ /* Number of lines in this viewport. During WPS parsing, this is
+ the index of the line being parsed. */
+ int num_lines;
+ struct wps_line lines[WPS_MAX_LINES];
+};
/* wps_data
this struct holds all necessary data which describes the
@@ -360,10 +371,9 @@ struct wps_data
bool remote_wps;
#endif
- /* Number of lines in the WPS. During WPS parsing, this is
- the index of the line being parsed. */
- int num_lines;
- struct wps_line lines[WPS_MAX_LINES];
+ /* Number of viewports in the WPS */
+ int num_viewports;
+ struct wps_viewport viewports[WPS_MAX_VIEWPORTS];
/* Total number of sublines in the WPS. During WPS parsing, this is
the index of the subline where the parsed tokens are added to. */
@@ -388,26 +398,30 @@ void wps_data_init(struct wps_data *wps_data);
/* to setup up the wps-data from a format-buffer (isfile = false)
from a (wps-)file (isfile = true)*/
bool wps_data_load(struct wps_data *wps_data,
+ struct screen *display,
const char *buf,
bool isfile);
/* Returns the index of the subline in the subline array
+ v - 0-based viewport number
line - 0-based line number
subline - 0-based subline number within the line
*/
-int wps_subline_index(struct wps_data *wps_data, int line, int subline);
+int wps_subline_index(struct wps_data *wps_data, int v, int line, int subline);
/* Returns the index of the first subline's token in the token array
+ v - 0-based viewport number
line - 0-based line number
subline - 0-based subline number within the line
*/
-int wps_first_token_index(struct wps_data *data, int line, int subline);
+int wps_first_token_index(struct wps_data *data, int v, int line, int subline);
/* Returns the index of the last subline's token in the token array.
+ v - 0-based viewport number
line - 0-based line number
subline - 0-based subline number within the line
*/
-int wps_last_token_index(struct wps_data *data, int line, int subline);
+int wps_last_token_index(struct wps_data *data, int v, int line, int subline);
/* wps_data end */