• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Themes
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by sithia - 2005-07-14
Last edited by linusnielsen - 2005-09-01

FS#2580 - Support for conditional images.

First crack at support for conditional images. Images
are loaded using %xl|n|filename.bmp|x|y| and displayed
with %xdn (where "n" is the image sequence number). %xl
can appear in the WPS after the %xd and still work just

Closed by  linusnielsen
2005-09-01 08:21
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Logged In: YES

Thanks, I have applied the patch, with some changes.

Project Manager

This is a good idea. I have a few suggestions that would
make it better, and I would also like to merge this patch
into CVS soonish, so we can include it in the 2.5 release.
It is certainly a bug that the wps can't have conditional

1) Keep the file name in the img struct and use that to
prevent the same BMP from being loaded twice, but instead
set the ptr to the already loaded bitmap. That way we can
have the same bitmap in several places without loading it twice.

2) Use a-z instead of 0-9 for the sequence numbers

3) Double the size of the bitmap buffer

The optimal solution for issue (1) would probably be to have
the coordinates in the %xd tag, but that may be a problem
for the parser.

I have a little time this week. I'm working out how to
reincorporate this into wps-display.c and I've got a couple

2) Using a-z is a bit overkill, don't you think? There are
only 10 slots in img (hence 0-9). MAX_IMAGES is currently 10.

You are correct about the parser having some problems with
the coordinates being housed with the display tag. Unless,
of course, we used a different separator character (like
','). I also think it's better to go with the display tag
but unless the conditionals are updated to handle the extra
'|' or a different separator is used I don't see how it can

Project Manager

The limitation of 10 isn't as sensible any more when you
start to use a new slot each time you position the same
picture on a new place. Thus it makes sense to extend the
MAX_IMAGES and if so, you need to support something else
than just 0-9…

Let's keep the display tag as you did it, as then this
should work fine with conditionals. Even with the upcoming
"enum conditonals" where you can set different things
depending on an enum (0,1,2,3, etc).

Project Manager

Thanks, I have applied the patch, with some changes.


Available keyboard shortcuts


Task Details

Task Editing