summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c (follow)
Commit message (Collapse)AuthorAge
* Fix dangerous castsAmaury Pouly2017-02-04
| | | | | | | | | On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is not valid. In any case, one should use intptr_t and ptrdiff_t when casting to integers. This commit attempts to fix all instances reported by GCC. When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
* add supports for x,y value in percentage to several tags.Chiwen Chang2014-07-21
| | | | | | | | | including BAR_PARAMS, %xl, %dr, %T,%St, %xl and %Cl Change-Id: I0811ebfff5f83085481dcbf08f97b7223f677bfe Reviewed-on: http://gerrit.rockbox.org/900 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* skin_engine: kill scrolling if the buffer movesJonathan Gordon2014-06-29
| | | | | | | | | | | | I have a suspicion that if there is any scrolling skin lines when the buflib buffer moves it will cause the lcd code to crash. This *hopefully* explains the random skin related crashed which have been reported. Change-Id: I04ee58292e1cea7c77ef9737b0641192f4f7e4ba Reviewed-on: http://gerrit.rockbox.org/877 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* fix indenting, editor went nutsJonathan Gordon2014-06-02
| | | | Change-Id: Ibe363e5c75260f50c6c6c6fc58a2758a7902ffc3
* skin_engine: Don't double free buflib handles shared by skin imagesJonathan Gordon2014-06-02
| | | | Change-Id: I4158fb7dae664a746141f458c08bdcb84e148041
* Also make sure progressbars don't tihnk their images are loadedJonathan Gordon2014-05-18
| | | | Change-Id: I83bb8e246e4858396ca0b5d0d90fbd2d08a88c1e
* fix skin buffer crashes, img's are not loaded initialyJonathan Gordon2014-05-18
| | | | Change-Id: I32b5d5e446f5ae9340be2bd47841b06a5dbabeec
* don't load the same bmp image more than once in a skinJonathan Gordon2014-05-14
| | | | Change-Id: Ie38146a80bb356f40810f017c262b81edac69688
* Implement time-based resume and playback start.Michael Sevakis2014-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This complements offset-based resume and playback start funcionality. The implementation is global on both HWCODEC and SWCODEC. Basically, if either the specified elapsed or offset are non-zero, it indicates a mid-track resume. To resume by time only, set elapsed to nonzero and offset to zero. To resume by offset only, set offset to nonzero and elapsed to zero. Which one the codec uses and which has priority is up to the codec; however, using an elapsed time covers more cases: * Codecs not able to use an offset such as VGM or other atomic formats * Starting playback at a nonzero elapsed time from a source that contains no offset, such as a cuesheet The change re-versions pretty much everything from tagcache to nvram. Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38 Reviewed-on: http://gerrit.rockbox.org/516 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
* skin_engine: Stricter checking for x, y, width, height for bar tags.Thomas Martitz2014-01-12
| | | | | | | Every theme that doesn't parse anymore now has broken values. I hope it's not too many of them. Change-Id: I6f52e55dc9197d0919f854240723a88f99c0b7da
* skin_engine: New param "noborder" for the bar tags.Thomas Martitz2014-01-12
| | | | | | | | | | By specifying this param the bar will not have a border/box. Instead the inner part that fills up is maximized on the bar area. Note that this only affects bars using foreground and background colors, not those constructed with images. Change-Id: Ib8dd49ecbaf9e16b96de840f5f365871b73d4fa4
* skin engine: Fix FS#12884.Thomas Martitz2014-01-10
| | | | | | | | | The %Vf and %Vb tags change the colors for the rest of the viewport. This requires the rest of the vp to be redrawn when they change due to a conditional. The previous code did this redraw in all cases (conditional or not) which led to visible blinking. Change-Id: Ie59dfc6fe8ed76485a2a2bd7caf1315f1944c227
* lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.Thomas Martitz2014-01-07
| | | | | | | These where used for line styling during scrolling, which is now done in apps/, The viewport struct doesn't need to record these anymore. Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
* skin_engine: Adapt put_line().Thomas Martitz2014-01-07
| | | | | | This allows for code unification and removal of a workaround (STYLE_XY_PIXELS). Change-Id: Ie92d377414cad943cdb06976af10b4f315f32710
* skin_engine: Fix albumart logic on skin reloading.Thomas Martitz2013-06-09
| | | | | | | | | | | This logic checks whether the skin's albumart dimensions differ from the previous skin to force rebuffering if necessary. This was broken since a while as the necessary information was reset. Change-Id: I3b9f3a819c6af202af8ad66c13742f704ce45ab1 Reviewed-on: http://gerrit.rockbox.org/476 Tested-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* checkwps: show a helpful error if the parser callback errors outJonathan Gordon2013-02-26
| | | | Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
* skin engine: Relax the AA load width/height checksJonathan Gordon2013-02-26
| | | | | | | | d6c6c07 changed the AA load tag to make sure the image width/heights fit in the viewport, Revert this because it doesn't actually make sense to check it here. Change-Id: I3fe4b074ef8fe88560f2f894ec651027ea3642f4
* skin_engine: Add a debug screen to display skin ram usageJonathan Gordon2013-02-12
| | | | Change-Id: Ida9c33211d9360ac88e30a2cf8df9f191bee8b45
* album art display: Fix RTL handling for the album art skin tagJonathan Gordon2013-01-15
| | | | | | | | | AA was broken when an RTL language is used, causing it to not be displayed. Also fix th out of bounds handling when width/height > viewport Change-Id: I4899cd32ec58107c987e3cc0e8df582963bdcf62
* 9 segment bitmap drawing:Jonathan Gordon2012-12-09
| | | | | | | | | | Use %x9(id) to draw an image in the whole current viewport using the 9 segment drawer (which draws the corners as normal and *tiles* the middle segments to the needed width/height). Future work is to make it scale instead of tile Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
* Fix skin engine error messageJonathan Gordon2012-08-06
| | | | Change-Id: I2250be6d4e82cd5d91ed1a2c080e263dd7543129
* skin_engine: Support percentages for viewport positioningJonathan Gordon2012-07-29
| | | | | | | | | | | %V(0,50%,75%,50%,-) - make a viewport at x=0, y=half the lcd height, 75% lcd width and the remaining height (the other half) of the lcd. Change-Id: If26ccb65e8dc52c9225f3fd6d7b222d770add0f0 Reviewed-on: http://gerrit.rockbox.org/184 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* skin_engine: Make pressing the setting bar touch region workJonathan Gordon2012-07-06
| | | | | | might need some tweaking, but works. Change-Id: I0784cd4fe9996531da6cc275491ff3b4e83cdbcf
* skin_engine: Allow the %St() (setting) skin tag be used as a barJonathan Gordon2012-07-05
| | | | | | %St(<setting name>) or %St(<bar tags>, setting, <setting name>) Change-Id: I71396d683634d4d1ad2357018c4029ecb4229677
* fix build warningsJonathan Gordon2012-07-05
| | | | Change-Id: Id5f0e84834f1cb74a317bb5653fdb6f665233345
* skin_engine: Automatically create touch regions for skin barsJonathan Gordon2012-07-05
| | | | | | | | | | | | | | | | | skin bars now automatically create the touch region the same size as the bar on touchscreen targets. This means touches will magically "just work" for reveresed bars (rtl or otherwise). ~5% padding is added on all 4 sides of the region rectangle but this may need to be tweaked. Please consider the 'progressbar' and 'volume' touchregion actions to be deprecated. Kudos to my new wife for figuring out the bleedingly obvious way to do this! Change-Id: I997a7bcaa70fce9885808aae27953c7676e9c2ff
* Fix checks on buflib allocated handles (0 is not a valid handle value)Bertrik Sikken2012-06-10
| | | | Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
* Fix FS#12674 - %ax() doesnt mirror viewport correctlyJonathan Gordon2012-05-30
| | | | Change-Id: I10c933542037eeedc9c4be74b3d43a1430ec05b2
* (hopefully) Fix FS#12639 and other skin related buflib corruption issues.Jonathan Gordon2012-05-16
| | | | | | | | | | | Kudos to funman for figuring out the problem - skin_find_item() rather stupidly uses the global skin_buffer variable in skin_parser.c which is fine in the parser EXCEPT it gets changed in skin_render when the sbs is being redrawn while another skin is loading, so fix this by makeing skin_find_item() use a local data pointer so a skin_render() during parsing won't break anything. Change-Id: I80e1c0efe569c18225e5772159c18ebb21e07332
* get_image_filename() return value is never usedRafaël Carré2012-05-06
|
* skin_parser: simplify skin_buffer_allocRafaël Carré2012-05-06
| | | | | | - no need to cast void * return value (it is not C++) - use sizeof(*var) instead of sizeof(struct foobar), it is shorter and will stay correct if the type is changed but forgotten in the sizeof()
* Use buflib for the allocation of voice PCM resources.Michael Sevakis2012-05-02
| | | | | | | | | | | | | Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
* skin_engine: Reenable skin debugging in the sim (use --debugwps)Jonathan Gordon2012-03-15
| | | | Change-Id: I2881edda45cd3ea69f5284d93bc93c47bb63b3f2
* Fix compile errorsJonathan Gordon2012-03-15
| | | | Change-Id: Ic985bf57da04847bff716ee41db8f107100ff95b
* skin_engine: New tag to draw a rectangle (optionally with a gradient)Jonathan Gordon2012-03-15
| | | | | | | | | | | %dr(x, y, width, height, [colour1[, colour2]]): x,y - viewport relative pixel coordinates to start the rectangle. width, height - obvious. can be '-' to fill the viewport if both colours are left out the viewports foreground colour will be used if one colour is specified it will fill the rectangle that colour. if both colours are specified it will gradient fill the rectangle. Change-Id: Iad451e99ded663bc7c5d182443659db7d909b388
* Add new actions to %Tp (Touchscreen areas)Osborne Jacobs2012-03-13
| | | | | | | | | | | | | | | Add the following actions to %Tp: createbookmark create a new bookmark from the wps listbookmarks list bookmarks from the wps trackinfo show track info from the wps My main motivation was to allow bookmarking and jumping around audio books from the wps on touch enabled targets. You can do it now through the context menu but it requires 4 screen presses instead of 1. Change-Id: I1fa1bf0064dfd22b897eca7c56acc1ce8956f14c Reviewed-on: http://gerrit.rockbox.org/171 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* skin_engine: ease the restrictions on %x/%xlJonathan Gordon2012-02-29
| | | | | | | | | %x and %xl only require the id and filename now. If you leave off the x,y it will default to 0,0. If you want to use the default x,y you can still put in the num_subimages param on the end (e.g %xl(a, file, 3) ) Change-Id: I8eff793dfdd037e302ace8deec9dc16dcea264a7
* skin_engine: Clean up %x() handling - beware theme issuesJonathan Gordon2012-02-28
| | | | | | | | | Internally remove some hacks around how %x() is handled. %x() inside the default viewport will no longer work if other viewports are used, so if you are using viewports and %x() make sure it is in a viewport! Change-Id: I8ecab805d55fc0f8476ff0516cba38e23400aa20
* lcd/skin_engine: Add the ability to draw onto the backdrop layerJonathan Gordon2012-02-28
| | | | | | | | | | | | | | The framebuffer the lcd driver uses can now be changed on the fly which means that regular lcd_* drawing functions can draw onto the "backdrop" buffer. The skin engine can use this to create layered effects. Add the tag %VB to a viewport to draw that viewport onto the backdrop layer. If you want to draw an image onto the backdrop framebuffer use %x(backdrop filename) instead of %X() inside a viewport with %VB. Change-Id: I741498e2af6d4f2d78932cabe8942317893e7cfc
* FS#12586 - Modify %ss to be able to use numbers for conditionalsJonathan Gordon2012-02-26
| | | | | | i.e %?ss(1,1,%cM)<|one|two|three|...|> or %xd(numbers, %ss(1,1%cM) Change-Id: I74ecb3f253f3be1fd270f75c0ef79addd364a7de
* Store listitem_viewport_cfg->label as skinoffset instead of raw pointerFrank Gevaerts2012-02-22
| | | | | | | | | This fixes the case where some blocks got relocated and the skin render code couldn't find the matching viewports any more. Change-Id: I4394444fb139ee5bc986f374dba82a104013e354 Reviewed-on: http://gerrit.rockbox.org/112 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
* skin engine: Add 'touch' command to the %vs() tagJonathan Gordon2012-02-21
| | | | | | | %vs(label, touch, -) will reset the timeout for the variable without changing the variables value. Change-Id: Idba03f454a82ac7460bb53a4de3aa6903656c585
* skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a ↵Jonathan Gordon2012-02-07
| | | | | | | | | | single conditional. Use these tags to stop having multiple conditionals.. e.g: OLD: %?C<%?Ia<something>> NEW: %?and(%C, %Ia)<something> Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
* skin touchregions: change the rwd/ffwd region actions to make it less buggy ↵Jonathan Gordon2012-01-28
| | | | | | in the sbs Change-Id: Ib823860e65909ac227910a16f6caac207b7e22c3
* skin touchregions: fix the 'none' region firing when it shouldnt.Jonathan Gordon2012-01-23
| | | | | | Change the none action return value so the various action layers don't get confused by ACTION_TOUCHSCREEN return codes which shouldn't be happening (i.e when a long press region overlaps a short press region whihc has the none action) Change-Id: I63db2c0b49597ada2c5ebd0ef98e99aeef4f522a
* skinengine: Rework skin loading so skins can be un/loaded individually. This ↵Jonathan Gordon2011-11-21
| | | | | | also means that loading a .cfg which doesnt change themes shouldnt have them reloaded git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31037 a1c6a512-1295-4272-9138-f99709370657
* Rename global_settings member glyphs to glyphs_to_cache and add descriptive ↵Fred Bauer2011-11-20
| | | | | | comment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31032 a1c6a512-1295-4272-9138-f99709370657
* FS#12293 Global default glyph setting in System > Limits > Glyphs To Cache. ↵Fred Bauer2011-11-19
| | | | | | Defaults to 250. This saves a lot of RAM while still allowing non-English users to have adequate glyph coverage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31031 a1c6a512-1295-4272-9138-f99709370657
* Get rid of a really annoying #ifdef line to check if backdrop support should ↵Jonathan Gordon2011-11-19
| | | | | | be enabled git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31027 a1c6a512-1295-4272-9138-f99709370657
* OOPS! Don't overwrite the trailing \0 from the skin text with the first ↵Jonathan Gordon2011-11-16
| | | | | | alloc (should fix FS#12388) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30998 a1c6a512-1295-4272-9138-f99709370657