Commit Graph

115 Commits

Author SHA1 Message Date
Boris Gjenero 8e6030c822 FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 21:45:25 +00:00
Jonathan Gordon b3caa01062 Fix FS#12237 (caused by r30302) where centered skin text isnt eqactly centered
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31246 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 09:48:52 +00:00
Jonathan Gordon 9e07ef2b0a Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs.

This removes all skin memory limitations

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
2011-11-15 14:11:08 +00:00
Thomas Martitz 13209604c1 Add new lcd_bmp and lcd_bmp_part APIs.
This new APIs wrap around lcd_[mono|transparent]_bitmap/_part calls and
handle all kinds bitmaps. The intended use is to draw bitmaps that
come from read_bmp_fd/_file.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30936 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 21:34:46 +00:00
Björn Stenberg 0942e2a0f7 Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:35:02 +00:00
Jonathan Gordon a483c9c6f1 Use buflib for skin images. Allows much more images to be loaded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30478 a1c6a512-1295-4272-9138-f99709370657
2011-09-08 12:38:21 +00:00
Jonathan Gordon 9b6ac01c7b Lists can now be completly draw using the skin engine!
due to lack of user feedback the actual tags may change, hopefully not though.

The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves).
Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern.
The UI viewport is used to bound the items (i.e %Vi() )
Scrolling is completly disabled in all items except the currently selected item.

This works well in combination with the %cs tag to show differently styled lists based on the current screen :)

New tags:
%LT - Get the current items text
%LI - Get the current items icon number
%Lc - Use as a conditional to determine if the current item is the selected item
%LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed
%Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list

example.sbs:
%?cs<%Lb(a,100,20)|>
%V(0,0,10,-,1)%Vf(aabbcc)
%?LB<%LB(0,0,10,185, invert)>
%Vi(-,10,0,-,-35,1)
%Vl(a,5,5,160,12,1)
%s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz            %LT         zzzzz%s%?Lc<%ar%<%<%<>
%V(0,185,-,-,1)
%s%LT

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:49:41 +00:00
Frank Gevaerts 9b9bd73dfb Fix last charcell warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30307 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:13:16 +00:00
Jonathan Gordon c3fe7b0f88 need... sleep... try again to fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30306 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:12:21 +00:00
Jonathan Gordon 810e9c4dcb fix charcell again.... wouldnt it be nice to remove charcell support all together? :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30305 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:04:46 +00:00
Jonathan Gordon 281f1a1ed6 New skin tags: %Vs() to set the text style and %Vg() to get the viewports gradient colours
%Vs(mode[, param]) : mode can be "invert", "color" (where param is the colour to use", "clear" to disable the current style, "gradient" where param is the number of lines the gradient should draw over.
%Vg(start colour, end colour, [text colour]), if this tag isnt used the list selection colours from the settings will set the gradient colours

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30302 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:50:07 +00:00
Bertrik Sikken ab99e941db More tab fixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29840 a1c6a512-1295-4272-9138-f99709370657
2011-05-08 20:35:29 +00:00
Jonathan Gordon 343001b5f8 Merge a bunch of code which is 99% identical so it makes it easier to add more of these later
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29535 a1c6a512-1295-4272-9138-f99709370657
2011-03-07 12:45:45 +00:00
Jonathan Gordon f06f685273 New option for the bar tags: 'backdrop, <label>' will draw another image under the progressbar (only works with image and slider bars)
example:
%V(22,253,198,14,-)
%xl(a,PLAY_BAR_BACKDROP-240x320x16.bmp,0,0)
%pb(0,0,198,14,PLAY_BAR-240x320x16.bmp, backdrop, a)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29127 a1c6a512-1295-4272-9138-f99709370657
2011-01-24 09:04:28 +00:00
Jonathan Gordon 519d65f9d6 remove unecessary (duplicated even) header
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29044 a1c6a512-1295-4272-9138-f99709370657
2011-01-13 06:54:35 +00:00
Jonathan Gordon 261c56ba59 FS#11867 - Add 2 new tags to allow skins to display themed peakmeters
%pL for the left channel, %pR for the right channel... usable as a value, conditional or bar (exactly the same as %pv/%bl/etc)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29043 a1c6a512-1295-4272-9138-f99709370657
2011-01-13 06:48:39 +00:00
Jonathan Gordon 1ce7ba4931 Make the %tr (radio RSSI) tag work as a bar tag or as a conditional.
As a conditional it scales its value to the number of options you give it (like volume)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28613 a1c6a512-1295-4272-9138-f99709370657
2010-11-18 11:47:42 +00:00
Jonathan Gordon 9acd242839 skin bar tag: Load an image from a label or filename. i.e %xl(bar_image, pb.bmp,0,0) %pb(0,0,10,10,bar_image) or %pb(0,0,10,10, pb.bmp) both are acceptable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28249 a1c6a512-1295-4272-9138-f99709370657
2010-10-12 12:46:57 +00:00
Teruaki Kawashima 3eb5826c8a improvement for bar tag with slider.
-fix bug the slider is drawn outside of the bounds (FS#11658).
-offset the slider position so that the center of the slider indicates current position.
-add nobar option. if this option is set, the bar isn't drawn at all.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28248 a1c6a512-1295-4272-9138-f99709370657
2010-10-12 12:17:39 +00:00
Frank Gevaerts 1f0ab7c9e6 Fix charcell %pb and %pf tags, FS#11592
This also moves draw_player_fullbar() and draw_player_progress() from skin_display.c to skin_tokens.c. Charcell is a bit different from bitmap here because drawing a progress bar is a combination of setting up the LCD controller (custom characters) and providing a format string. The custom character definition might fit in skin_display.c, but the format strings are needed in skin_tokens.c. Putting these functions in skin_tokens.c seemed to fit better.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28241 a1c6a512-1295-4272-9138-f99709370657
2010-10-10 23:46:15 +00:00
Teruaki Kawashima cc8918e909 fix displaying of the slider when default is used for pb->y and pb->height.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28220 a1c6a512-1295-4272-9138-f99709370657
2010-10-08 14:26:36 +00:00
Jonathan Gordon dd6b1dc5d2 Fix FS#11651 - slider wasnt being drawn correctly with inverted (and vertical) bars
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28207 a1c6a512-1295-4272-9138-f99709370657
2010-10-04 13:20:37 +00:00
Teruaki Kawashima 0f8fe94f46 correct drawing of the bar type tags when nofill is set.
draw the slider bitmap before drawing A-B repeat markers so that they are visible.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28204 a1c6a512-1295-4272-9138-f99709370657
2010-10-03 14:19:30 +00:00
Jonathan Gordon 71379cafb1 fix errors, warnings, tabs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28075 a1c6a512-1295-4272-9138-f99709370657
2010-09-14 12:21:56 +00:00
Jonathan Gordon 9928e3418f Another major skin backend update/hopefully bugfix:
Skins are now more self contained in the skin manager which in the future might allow on demand skin loading (i.e smaller skin buffers)
Skin backdrops are also managed more intelegently (fixes a bug where you can get a crazy backdrop loaded if a .sbs fails to load)

the rockbox_default rescue theme is now called rockbox_failsafe to better express what it actually is.

This commit hopefully/maybe fixes the heavily reported data aborts, so please check if you are getting them

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28073 a1c6a512-1295-4272-9138-f99709370657
2010-09-14 11:56:50 +00:00
Jonathan Gordon 216ed29e4d fix FS#11588 - %t(0) inside conditionals wasnt making that subline skip
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27983 a1c6a512-1295-4272-9138-f99709370657
2010-09-02 11:43:33 +00:00
Jonathan Gordon eda80390d5 A bunch of new features for the bar type tags (%pb, %pv, %bl, etc):
* the bar orientation (horiz/vert) is now chosen based on the width and heigt values (or can be forced).
* the fill direction can now be inverted (fill right to left, or top to bottom is considered inverted)
* It can now draw a slider type bar instead of a fill type (or indeed a slider with a fill type)

To configure the new bar, any (or all) of the following params can be used after the bmp filename (order makes no difference either):
invert - cause the bar to fill in the inverted direction
vertical - draw a vertical bar (not needed if the height > width)
horizontal - draw a horizontal bar (this is obviously the default)
nofill - dont draw the filling bar (this still draws the outline, obviously pointless without the slider param)
slider - draw an image for the slider. The next param MUST be the label of the image to draw. No option to use a subimage here, so the whole image needs to be the image you want on the slider. 

example: %pb(0,0,-,-,-,nofill, slider, slider_image, invert) - draw a boring horizontal progressbar which doesnt fill and only draws the image "slider_image" which moves right to left.

the slider type might need some tweaking. let us know how it goes


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27821 a1c6a512-1295-4272-9138-f99709370657
2010-08-15 14:13:36 +00:00
Jonathan Gordon dc3778a685 Rework the skin playlist viewer so it uses the same drawing code as everything else. This should mean that all text tags now work as expected. The 2nd code param is no longer needed so drop it (you can use conditionals and sublines and stuff in the one code param.
example: %Vp(1, %?it<%in -%it|%fn>) <- show the next tracks strating from the first next track and show info if it is avilable or the filename.
Basic cuesheet support here, and will load upcoming track tags from the database if you have load to ram enabled.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27814 a1c6a512-1295-4272-9138-f99709370657
2010-08-14 15:17:59 +00:00
Jonathan Gordon 70ebe46d74 New feature for the %xl (image load) tag. If you give it the filename __list_icons__ it will use the list icon strip instead of loading a different bmp.
example:
%xl(I, __list_icons__, 0, 0)
%xd(I, %Li)

^ display the list icon at position 0,0 in that viewport. (you can of course %xd(Ia) if you really wanted also.)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27787 a1c6a512-1295-4272-9138-f99709370657
2010-08-12 13:27:10 +00:00
Magnus Holmgren 113764d9c0 Fix FS#11175. playlist_peek() wasn't thread safe (due to a static filename buffer), so frequent calls from the main thread would cause the audio thread to buffer the wrong track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27773 a1c6a512-1295-4272-9138-f99709370657
2010-08-11 19:01:50 +00:00
Jonathan Gordon ee4f8a9a6b Allow viewport labels to be mostly free text instead of only one character. If this is useful the same will be done for images
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27665 a1c6a512-1295-4272-9138-f99709370657
2010-08-02 12:50:23 +00:00
Bertrik Sikken 57933f2bc6 Make some global function/variables local (by making them static)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27631 a1c6a512-1295-4272-9138-f99709370657
2010-07-30 23:47:49 +00:00
Jonathan Gordon 2d31d77a8b FS#11470 - new skin code, finally svn uses the new parser from the theme editor. This means that a skin that passes the editor WILL pass svn and checkwps (unless the target runs out of skin buffer or something.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27613 a1c6a512-1295-4272-9138-f99709370657
2010-07-29 12:37:48 +00:00
Jonathan Gordon fa99c614b9 hopefully fix the problem with lines in viewports being pushed down one line.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26682 a1c6a512-1295-4272-9138-f99709370657
2010-06-08 07:24:42 +00:00
Jonathan Gordon 5b0521c9aa Changeover to the new skin format. SkinBreakingChange in the wiki has the runown of the changes.
Major changes are paramerterised tags now use %tag(param,param), colours are removed from the %V() tag, %Vi gets a required (but can be -) label as its first param).

utils/skinupdater/ has a program to update individual skins, and a perl script to update a whole zip.
Themesite will be unusable for the time being (you should be able to upload new themes once it updates checkwps though).

I obviously havnt tested every updated wps in this change so let me know if one doesnt load


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26641 a1c6a512-1295-4272-9138-f99709370657
2010-06-07 03:44:11 +00:00
Jonathan Gordon 28833f09e2 don't draw the presets on the FM frequency bar, they look like crap. This will come back when they are configurable shortly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26628 a1c6a512-1295-4272-9138-f99709370657
2010-06-06 13:23:52 +00:00
Jonathan Gordon 22b12cafbb draw markers on the FM frequency bar for presets (like cuesheet markers in the WPS).
seems nice but if it ends up looking crap we can revert..


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26429 a1c6a512-1295-4272-9138-f99709370657
2010-05-31 11:12:15 +00:00
Jonathan Gordon dcbf4bbdea make radioart work in the sbs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26221 a1c6a512-1295-4272-9138-f99709370657
2010-05-21 02:35:11 +00:00
Jonathan Gordon f531adc312 pass pointers around instead of coping whole structs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26197 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 15:27:17 +00:00
Jonathan Gordon 0a7a7ce213 count is being used as the value of the last item to show, so rename it to not be confusing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26096 a1c6a512-1295-4272-9138-f99709370657
2010-05-17 04:08:07 +00:00
Jonathan Gordon 908a5b6a7b the fm presets list should wrap.. so make that work
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26095 a1c6a512-1295-4272-9138-f99709370657
2010-05-17 02:29:20 +00:00
Jonathan Gordon caa4f54e42 fix a minor fms presetlist viewer bug with displaying prev when you are on the first playlist
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26087 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 13:32:43 +00:00
Jonathan Gordon 7d5e0d7375 FS#11263 - Radio Art support! %C and %Cl tags work in the radio screen and Base Skin when the radio is running.
put your station images in .rockbox/fmpresets/<preset name>.bmp or .jpg. Must be in preset mode and the preset name must match the filename


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26078 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 11:13:42 +00:00
Jonathan Gordon 182d13e3ab fix the freq bar after music plays
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25983 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 06:59:16 +00:00
Jonathan Gordon 3fbe4d275e fix FS#11264 - frequency bar and presets not working in the sbs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25982 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 06:56:21 +00:00
Jonathan Gordon a5d8d21596 fix the last of the reds, and make RDS tags actually work (and add them to the hardcoded radio skin)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25966 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 11:44:09 +00:00
Jonathan Gordon 7b931f0a5a fix red and yellow (most of it anyway)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25965 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 10:59:20 +00:00
Jonathan Gordon 1bd072c92d FS#10853 - Skin support in the radio screen! Check CustomWPS for the new tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25964 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 10:38:00 +00:00
Jonathan Gordon 38ef849d06 slightly rework peakmeter handling to make it cleaner and be able to be used in conditionals
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25913 a1c6a512-1295-4272-9138-f99709370657
2010-05-09 13:01:59 +00:00
Steve Bavin b08222caec Minor const police raid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25879 a1c6a512-1295-4272-9138-f99709370657
2010-05-07 16:35:37 +00:00