diff options
Diffstat (limited to 'apps/gui/gwps.h')
-rw-r--r-- | apps/gui/gwps.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index d31471c2a4..e72b41308b 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -88,7 +88,7 @@ struct align_pos { | |||
88 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) | 88 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) |
89 | 89 | ||
90 | #define WPS_MAX_VIEWPORTS 16 | 90 | #define WPS_MAX_VIEWPORTS 16 |
91 | #define WPS_MAX_LINES (LCD_HEIGHT/5+1) | 91 | #define WPS_MAX_LINES ((LCD_HEIGHT/5+1) * 2) |
92 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) | 92 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) |
93 | #define WPS_MAX_TOKENS 1024 | 93 | #define WPS_MAX_TOKENS 1024 |
94 | #define WPS_MAX_STRINGS 128 | 94 | #define WPS_MAX_STRINGS 128 |
@@ -321,10 +321,9 @@ struct wps_line { | |||
321 | struct wps_viewport { | 321 | struct wps_viewport { |
322 | struct viewport vp; /* The LCD viewport struct */ | 322 | struct viewport vp; /* The LCD viewport struct */ |
323 | 323 | ||
324 | /* Number of lines in this viewport. During WPS parsing, this is | 324 | /* Indexes of the first and last lines belonging to this viewport in the |
325 | the index of the line being parsed. */ | 325 | lines[] array */ |
326 | int num_lines; | 326 | int first_line, last_line; |
327 | struct wps_line lines[WPS_MAX_LINES]; | ||
328 | }; | 327 | }; |
329 | 328 | ||
330 | /* wps_data | 329 | /* wps_data |
@@ -371,10 +370,16 @@ struct wps_data | |||
371 | bool remote_wps; | 370 | bool remote_wps; |
372 | #endif | 371 | #endif |
373 | 372 | ||
373 | /* Number of lines in the WPS. During WPS parsing, this is | ||
374 | the index of the line being parsed. */ | ||
375 | int num_lines; | ||
376 | |||
374 | /* Number of viewports in the WPS */ | 377 | /* Number of viewports in the WPS */ |
375 | int num_viewports; | 378 | int num_viewports; |
376 | struct wps_viewport viewports[WPS_MAX_VIEWPORTS]; | 379 | struct wps_viewport viewports[WPS_MAX_VIEWPORTS]; |
377 | 380 | ||
381 | struct wps_line lines[WPS_MAX_LINES]; | ||
382 | |||
378 | /* Total number of sublines in the WPS. During WPS parsing, this is | 383 | /* Total number of sublines in the WPS. During WPS parsing, this is |
379 | the index of the subline where the parsed tokens are added to. */ | 384 | the index of the subline where the parsed tokens are added to. */ |
380 | int num_sublines; | 385 | int num_sublines; |
@@ -403,25 +408,22 @@ bool wps_data_load(struct wps_data *wps_data, | |||
403 | bool isfile); | 408 | bool isfile); |
404 | 409 | ||
405 | /* Returns the index of the subline in the subline array | 410 | /* Returns the index of the subline in the subline array |
406 | v - 0-based viewport number | ||
407 | line - 0-based line number | 411 | line - 0-based line number |
408 | subline - 0-based subline number within the line | 412 | subline - 0-based subline number within the line |
409 | */ | 413 | */ |
410 | int wps_subline_index(struct wps_data *wps_data, int v, int line, int subline); | 414 | int wps_subline_index(struct wps_data *wps_data, int line, int subline); |
411 | 415 | ||
412 | /* Returns the index of the first subline's token in the token array | 416 | /* Returns the index of the first subline's token in the token array |
413 | v - 0-based viewport number | ||
414 | line - 0-based line number | 417 | line - 0-based line number |
415 | subline - 0-based subline number within the line | 418 | subline - 0-based subline number within the line |
416 | */ | 419 | */ |
417 | int wps_first_token_index(struct wps_data *data, int v, int line, int subline); | 420 | int wps_first_token_index(struct wps_data *data, int line, int subline); |
418 | 421 | ||
419 | /* Returns the index of the last subline's token in the token array. | 422 | /* Returns the index of the last subline's token in the token array. |
420 | v - 0-based viewport number | ||
421 | line - 0-based line number | 423 | line - 0-based line number |
422 | subline - 0-based subline number within the line | 424 | subline - 0-based subline number within the line |
423 | */ | 425 | */ |
424 | int wps_last_token_index(struct wps_data *data, int v, int line, int subline); | 426 | int wps_last_token_index(struct wps_data *data, int line, int subline); |
425 | 427 | ||
426 | /* wps_data end */ | 428 | /* wps_data end */ |
427 | 429 | ||