diff options
Diffstat (limited to 'apps/gui/gwps.h')
-rw-r--r-- | apps/gui/gwps.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 70f4c560c6..d31471c2a4 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -61,6 +61,7 @@ | |||
61 | #ifdef HAVE_LCD_BITMAP | 61 | #ifdef HAVE_LCD_BITMAP |
62 | struct gui_img{ | 62 | struct gui_img{ |
63 | struct bitmap bm; | 63 | struct bitmap bm; |
64 | struct viewport* vp; /* The viewport to display this image in */ | ||
64 | int x; /* x-pos */ | 65 | int x; /* x-pos */ |
65 | int y; /* y-pos */ | 66 | int y; /* y-pos */ |
66 | bool loaded; /* load state */ | 67 | bool loaded; /* load state */ |
@@ -86,6 +87,7 @@ struct align_pos { | |||
86 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ | 87 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ |
87 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) | 88 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) |
88 | 89 | ||
90 | #define WPS_MAX_VIEWPORTS 16 | ||
89 | #define WPS_MAX_LINES (LCD_HEIGHT/5+1) | 91 | #define WPS_MAX_LINES (LCD_HEIGHT/5+1) |
90 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) | 92 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) |
91 | #define WPS_MAX_TOKENS 1024 | 93 | #define WPS_MAX_TOKENS 1024 |
@@ -95,6 +97,7 @@ struct align_pos { | |||
95 | 97 | ||
96 | #else | 98 | #else |
97 | 99 | ||
100 | #define WPS_MAX_VIEWPORTS 2 | ||
98 | #define WPS_MAX_LINES 2 | 101 | #define WPS_MAX_LINES 2 |
99 | #define WPS_MAX_SUBLINES 12 | 102 | #define WPS_MAX_SUBLINES 12 |
100 | #define WPS_MAX_TOKENS 64 | 103 | #define WPS_MAX_TOKENS 64 |
@@ -315,6 +318,14 @@ struct wps_line { | |||
315 | long subline_expire_time; | 318 | long subline_expire_time; |
316 | }; | 319 | }; |
317 | 320 | ||
321 | struct wps_viewport { | ||
322 | struct viewport vp; /* The LCD viewport struct */ | ||
323 | |||
324 | /* Number of lines in this viewport. During WPS parsing, this is | ||
325 | the index of the line being parsed. */ | ||
326 | int num_lines; | ||
327 | struct wps_line lines[WPS_MAX_LINES]; | ||
328 | }; | ||
318 | 329 | ||
319 | /* wps_data | 330 | /* wps_data |
320 | this struct holds all necessary data which describes the | 331 | this struct holds all necessary data which describes the |
@@ -360,10 +371,9 @@ struct wps_data | |||
360 | bool remote_wps; | 371 | bool remote_wps; |
361 | #endif | 372 | #endif |
362 | 373 | ||
363 | /* Number of lines in the WPS. During WPS parsing, this is | 374 | /* Number of viewports in the WPS */ |
364 | the index of the line being parsed. */ | 375 | int num_viewports; |
365 | int num_lines; | 376 | struct wps_viewport viewports[WPS_MAX_VIEWPORTS]; |
366 | struct wps_line lines[WPS_MAX_LINES]; | ||
367 | 377 | ||
368 | /* Total number of sublines in the WPS. During WPS parsing, this is | 378 | /* Total number of sublines in the WPS. During WPS parsing, this is |
369 | the index of the subline where the parsed tokens are added to. */ | 379 | 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); | |||
388 | /* to setup up the wps-data from a format-buffer (isfile = false) | 398 | /* to setup up the wps-data from a format-buffer (isfile = false) |
389 | from a (wps-)file (isfile = true)*/ | 399 | from a (wps-)file (isfile = true)*/ |
390 | bool wps_data_load(struct wps_data *wps_data, | 400 | bool wps_data_load(struct wps_data *wps_data, |
401 | struct screen *display, | ||
391 | const char *buf, | 402 | const char *buf, |
392 | bool isfile); | 403 | bool isfile); |
393 | 404 | ||
394 | /* Returns the index of the subline in the subline array | 405 | /* Returns the index of the subline in the subline array |
406 | v - 0-based viewport number | ||
395 | line - 0-based line number | 407 | line - 0-based line number |
396 | subline - 0-based subline number within the line | 408 | subline - 0-based subline number within the line |
397 | */ | 409 | */ |
398 | int wps_subline_index(struct wps_data *wps_data, int line, int subline); | 410 | int wps_subline_index(struct wps_data *wps_data, int v, int line, int subline); |
399 | 411 | ||
400 | /* Returns the index of the first subline's token in the token array | 412 | /* Returns the index of the first subline's token in the token array |
413 | v - 0-based viewport number | ||
401 | line - 0-based line number | 414 | line - 0-based line number |
402 | subline - 0-based subline number within the line | 415 | subline - 0-based subline number within the line |
403 | */ | 416 | */ |
404 | int wps_first_token_index(struct wps_data *data, int line, int subline); | 417 | int wps_first_token_index(struct wps_data *data, int v, int line, int subline); |
405 | 418 | ||
406 | /* Returns the index of the last subline's token in the token array. | 419 | /* Returns the index of the last subline's token in the token array. |
420 | v - 0-based viewport number | ||
407 | line - 0-based line number | 421 | line - 0-based line number |
408 | subline - 0-based subline number within the line | 422 | subline - 0-based subline number within the line |
409 | */ | 423 | */ |
410 | int wps_last_token_index(struct wps_data *data, int line, int subline); | 424 | int wps_last_token_index(struct wps_data *data, int v, int line, int subline); |
411 | 425 | ||
412 | /* wps_data end */ | 426 | /* wps_data end */ |
413 | 427 | ||