diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-23 06:04:17 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-23 06:04:17 +0000 |
commit | 5a169bb71707dae31a886e1b932341b70eacf2df (patch) | |
tree | e6823f6addf964c292383182e1cbb077328c770d /apps/gui/gwps.h | |
parent | 66530722928b5e3c9870feb121c261e138807492 (diff) | |
download | rockbox-5a169bb71707dae31a886e1b932341b70eacf2df.tar.gz rockbox-5a169bb71707dae31a886e1b932341b70eacf2df.zip |
commit FS#9027 - conditional viewports
** BREAKS CURRENT WPS's **
* %P has been removed, merged with the new %pb
* %pb is now %pb or %pb|bitmap|x|y|width|height| (any of those params can be - to use sane defaults... check wiki/task for more explaination)
* New %Vl and %Vd tags which are used to setup and display conditionaly displayed viewports (%Vl|<id>|<usual %V params>| to set up, then %Vd<id> to enable the viewport
* bumps the max allowed viewport count to 24
* you can setup 3 different progressbars in a WPS... max of one per viewport though
http://www.rockbox.org/tracker/task/9027?getfile=16785 is a simple perl script to convert old %P/%pb to the new %pb syntax
I'll commit changes to the cabbie wps soon which shows how to use %Vl/%Vd properly...
Reminder: %m will be removed soonish also so when fixing your WPS's remember to use conditional viewports to replace %m
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17759 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/gwps.h')
-rw-r--r-- | apps/gui/gwps.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 494d12a084..25cfc08505 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -70,7 +70,13 @@ struct gui_img{ | |||
70 | bool always_display; /* not using the preload/display mechanism */ | 70 | bool always_display; /* not using the preload/display mechanism */ |
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct prog_img{ /*progressbar image*/ | 73 | struct progressbar { |
74 | /* regular pb */ | ||
75 | short x; | ||
76 | short y; | ||
77 | short width; | ||
78 | short height; | ||
79 | /*progressbar image*/ | ||
74 | struct bitmap bm; | 80 | struct bitmap bm; |
75 | bool have_bitmap_pb; | 81 | bool have_bitmap_pb; |
76 | }; | 82 | }; |
@@ -85,6 +91,7 @@ struct align_pos { | |||
85 | #ifdef HAVE_LCD_BITMAP | 91 | #ifdef HAVE_LCD_BITMAP |
86 | 92 | ||
87 | #define MAX_IMAGES (26*2) /* a-z and A-Z */ | 93 | #define MAX_IMAGES (26*2) /* a-z and A-Z */ |
94 | #define MAX_PROGRESSBARS 3 | ||
88 | 95 | ||
89 | /* The image buffer is big enough to store one full-screen native bitmap, | 96 | /* The image buffer is big enough to store one full-screen native bitmap, |
90 | plus two full-screen mono bitmaps. */ | 97 | plus two full-screen mono bitmaps. */ |
@@ -92,7 +99,7 @@ struct align_pos { | |||
92 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ | 99 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ |
93 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) | 100 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) |
94 | 101 | ||
95 | #define WPS_MAX_VIEWPORTS 16 | 102 | #define WPS_MAX_VIEWPORTS 24 |
96 | #define WPS_MAX_LINES ((LCD_HEIGHT/5+1) * 2) | 103 | #define WPS_MAX_LINES ((LCD_HEIGHT/5+1) * 2) |
97 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) | 104 | #define WPS_MAX_SUBLINES (WPS_MAX_LINES*3) |
98 | #define WPS_MAX_TOKENS 1024 | 105 | #define WPS_MAX_TOKENS 1024 |
@@ -271,8 +278,11 @@ enum wps_token_type { | |||
271 | 278 | ||
272 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) | 279 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
273 | /* Virtual LED */ | 280 | /* Virtual LED */ |
274 | WPS_TOKEN_VLED_HDD | 281 | WPS_TOKEN_VLED_HDD, |
275 | #endif | 282 | #endif |
283 | |||
284 | /* Viewport display */ | ||
285 | WPS_VIEWPORT_ENABLE | ||
276 | }; | 286 | }; |
277 | 287 | ||
278 | struct wps_token { | 288 | struct wps_token { |
@@ -323,12 +333,17 @@ struct wps_line { | |||
323 | long subline_expire_time; | 333 | long subline_expire_time; |
324 | }; | 334 | }; |
325 | 335 | ||
336 | #define VP_DRAW_HIDEABLE 0x1 | ||
337 | #define VP_DRAW_HIDDEN 0x2 | ||
338 | #define VP_DRAW_WASHIDDEN 0x4 | ||
326 | struct wps_viewport { | 339 | struct wps_viewport { |
327 | struct viewport vp; /* The LCD viewport struct */ | 340 | struct viewport vp; /* The LCD viewport struct */ |
328 | 341 | struct progressbar *pb; | |
329 | /* Indexes of the first and last lines belonging to this viewport in the | 342 | /* Indexes of the first and last lines belonging to this viewport in the |
330 | lines[] array */ | 343 | lines[] array */ |
331 | int first_line, last_line; | 344 | int first_line, last_line; |
345 | char hidden_flags; | ||
346 | char label; | ||
332 | }; | 347 | }; |
333 | 348 | ||
334 | /* wps_data | 349 | /* wps_data |
@@ -338,17 +353,15 @@ struct wps_data | |||
338 | { | 353 | { |
339 | #ifdef HAVE_LCD_BITMAP | 354 | #ifdef HAVE_LCD_BITMAP |
340 | struct gui_img img[MAX_IMAGES]; | 355 | struct gui_img img[MAX_IMAGES]; |
341 | struct prog_img progressbar; | ||
342 | unsigned char img_buf[IMG_BUFSIZE]; | 356 | unsigned char img_buf[IMG_BUFSIZE]; |
343 | unsigned char* img_buf_ptr; | 357 | unsigned char* img_buf_ptr; |
344 | int img_buf_free; | 358 | int img_buf_free; |
345 | bool wps_sb_tag; | 359 | bool wps_sb_tag; |
346 | bool show_sb_on_wps; | 360 | bool show_sb_on_wps; |
347 | 361 | ||
348 | short progress_top; | 362 | struct progressbar progressbar[MAX_PROGRESSBARS]; |
349 | short progress_height; | 363 | short progressbar_count; |
350 | short progress_start; | 364 | |
351 | short progress_end; | ||
352 | bool peak_meter_enabled; | 365 | bool peak_meter_enabled; |
353 | 366 | ||
354 | #ifdef HAVE_ALBUMART | 367 | #ifdef HAVE_ALBUMART |