summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_parser.c
AgeCommit message (Collapse)AuthorFilesLines
2024-04-01[Fix Yellow] 1dc22c7241 use path_append for setting directories is several ↵William Wilgus1-0/+1
settings Change-Id: I30ee97f7f47d52c178de05bcabb62b65fcd9d784
2024-04-01use path_append for setting directories is several settingsWilliam Wilgus1-1/+1
sprintf, strcpy, memccpy can all just go thru path_append with the added benefit of some path sanitizing too Change-Id: I33510b56a364b8b3a0b06f2ff14b76491f6e3870
2023-11-18Skin Engine: Fix loading images with same file nameChristian Soffke1-0/+2
Looks like this was a regression introduced in 01cbb79. The duplicate img uses an existing buflib handle for the data, but still didn't have access to the dimensions from the bitmap struct. Test case: DancePuffDuo theme for Sansa E200. Only one dancepuff was displayed. Thank you to goatikins for reporting the issue. Change-Id: I32c3ebd1f00738f7db52e7a66f98c4ab3489ee4a
2023-06-22skin: Fix minor compile warning caused by printf with size_tSolomon Peachy1-2/+2
Change-Id: I785d1dd05ac8ef81d817cdd1f7d1867c158bfadf
2023-06-09Skin Engine: Enable dithering for images drawn onto backdrop layerChristian Soffke1-3/+12
Backdrop images loaded using %X(filename) already had dithering enabled, but images loaded using the %x tag in viewports annotated with %VB did not. Change-Id: I9c6d11d8e7ab41a53eb9e453d78ae0dc58cb947b
2023-01-13Remove buflib allocation names, part twoAidan MacDonald1-2/+1
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2022-12-20[Fix Red] consolidate bmp_read function between icons and skin_parserWilliam Wilgus1-1/+2
Change-Id: I642ec2272ac94233127d8670f6adee938e53bce0
2022-12-20consolidate bmp_read function between icons and skin_parserWilliam Wilgus1-48/+31
uses fd now rather than opening file twice Change-Id: If35418cbc77adacf5e96fb6aa0fc8ffef2fffcbd
2022-12-17settings: Remove setting ID return from find_setting()Aidan MacDonald1-3/+3
Now that all users have replaced setting IDs with direct pointers, find_setting() and friends don't need to return an ID value. Change-Id: I8c5c31bb68d3bca5350d43538335265a55fd5517
2022-12-04skin engine: Settings ID to pointer conversionsAidan MacDonald1-7/+9
Convert %St tag to operate on settings pointers instead of IDs. Change-Id: Iabf4c280be82b495a64b560b59620fb477e0c738
2022-12-04settings: Settings ID to pointer for cfg_string_to_int()Aidan MacDonald1-16/+16
Accept a pointer to struct settings_list instead of an index in the settings array. Refactor the skin engine's touchregion_setup_setting() to avoid the use of indices. Change-Id: I784a5e49205da6874b8b419dd5413f722ad45b67
2022-11-23skin engine: Remove albumart viewport fieldAidan MacDonald1-8/+0
The viewport field in albumart is unnecessary, but for a different reason than eg. the progressbar was. The skin engine draws images by going over a global list of images shared between all viewports. Prior to drawing a viewport, every image is marked "not displayed." When an image display tag is encountered during rendering this mark is set to the index of the subimage to be displayed. The albumart is handled similarily, by setting a handle to -1 and then updating it when the %Cd tag is encountered. The albumart is not drawn unless the handle is set to >= 0 by the %Cd tag. So we don't need to track or check viewports at all, because only the viewport that contains the %Cd tag will ever draw the albumart. Change-Id: Ibc0233d168012759325d3c16dc317de9ad3dcf6c
2022-11-23skin engine: Remove viewport_colour viewport fieldAidan MacDonald1-1/+0
Yet again, no need to store the viewport because we already know it -- and this time the render code is obviously relying on that assumption. Change-Id: Id5eb7cd9999fbe1efccd54bd8f0fd3c8a3011c8e
2022-11-23skin engine: Remove progressbar viewport fieldAidan MacDonald1-1/+0
Again, we don't need to store the viewport in the progressbar struct because it's known at render time. Change-Id: I12514ceaace7c897194b18929364340871ef4635
2022-11-17skin engine: Remove playlistviewer viewport fieldAidan MacDonald1-1/+0
We already know the viewport at render time (I think... at least this seems to be the case for themes I tested) so there's no need to store a pointer to the viewport. Change-Id: I75fa2262e96c6f735e6b5da33cd4ca9ac68cd2ee
2022-11-17Remove get_viewport_default_colour()Aidan MacDonald1-2/+29
The function isn't used except for the skin engine's %Vf/%Vb tags, so inline it there and remove the separate function. Change-Id: Ia207321877234bc3679457c820a4292ae53f3520
2022-11-14replace strlcpy with strmemccpyWilliam Wilgus1-1/+1
replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-10skin engine: Remove gui_img viewport fieldAidan MacDonald1-4/+0
This is set but never used. Change-Id: Ifbeaa843ef070ea178cc270ffcade0d57a4fb45f
2022-10-16Convert a number of allocations to use buflib pinningAidan MacDonald1-13/+3
Several places in the codebase implemented an ad-hoc form of pinning; they can be converted to use buflib pinning instead. Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
2022-10-15skin_engine fix invalid buflib handle checksWilliam Wilgus1-2/+1
buflib considers handles <= 0 as invalid skin engine was using handles < 0 Change-Id: Ie156223a43039d48ef4846fe31e6191630fa7c04
2022-10-15skin_engine fix free pointer crashWilliam Wilgus1-0/+1
skin_engine uses -1 to signify a free handle 0 causes crash Change-Id: I1db8743c14dd244fe92973e31bac61efdd12ca7f
2022-10-15move buflib_free invalid handle check to the functionWilliam Wilgus1-3/+1
allow buflib_free to check for invalid or already freed handles within the function -- remove all the invalid handle guards thru core_free Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
2022-10-01skin engine: Fix bug with %Vs(color) tagAidan MacDonald1-1/+2
The %Vs(color) tag doesn't set the text style properly and causes the background to not be cleared when rendering lines. For static text this is rarely a problem, but for scrolling text it'll cause the text to "smear" once it starts scrolling. Fix this by setting STYLE_DEFAULT, so the background gets redrawn when the line scrolls. Bug report: https://forums.rockbox.org/index.php/topic,54320.0.html Change-Id: I835c806005ea40fd6bac3692e52a9c325581a293
2022-05-03add const to const * stringsWilliam Wilgus1-3/+3
I don't think this will amke any difference except maybe for hosted ports Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-02Fix some non-portable alignment valuesAidan MacDonald1-2/+3
UBSan reports an avalanche of unaligned pointer bugs stemming from hardcoded 4-byte alignments used in certain places. Use sizeof(long) instead to align to the machine word size. Change-Id: I28e505212462c5268afa24e95df3a103ac3e2213
2022-03-14BUGFIX string_option parsersWilliam Wilgus1-5/+8
fix bugs introduced in the switch over to using string_option instead of if else strcmp trees, embedded album art should work again skin parser had an error for 'noborder' and 'nobar' Change-Id: I957d81e5fa8467b33bbd93d63c4428c36100acca
2022-03-13option_string clean-up and consolidate with metadata_commonWilliam Wilgus1-8/+4
Change-Id: I2649f6af37bd871fb8f181ae2f716ff0bcf1f65c
2022-03-13skin_parser.c fix red stupid typoWilliam Wilgus1-1/+1
Change-Id: If4830afc84b32e79ec5aef7add8574485c11af3c
2022-03-13skin_parser.c fix redWilliam Wilgus1-1/+1
Change-Id: If093ad790f63d39855bf3253ae7a6c11afcc1a96
2022-03-13add function string_option to misc.c use in skin_parser.cWilliam Wilgus1-29/+61
function string_option allows a string to be found in a supplied list of options Change-Id: If9134090406b74ab11f4ef9ed6517a4b99b9d73e
2022-03-08skinparser cleanup, optimizeWilliam Wilgus1-61/+100
hash clause strings for =, ==, !=, <, > <=, >= store result of get_param() where possible Change-Id: Ia5a4dbf613d6ec9e21546fa0c6a8de28eb7aa347
2021-11-21touchscreen: change odd sentinel value for time of last touchAidan MacDonald1-2/+2
Using tick 0xffff does not make any sense, use -1 instead. Change-Id: Id574eb35418c6713c4fc91ed539aadc42fd29aa5
2021-10-13skin engine - fail gracefully when %Sx is used on non lang id stringWilliam Wilgus1-1/+1
CheckWPS doesn't catch errors involving translated strings Instead of breaking old themes when the langids no long exist return "<ERR>" Change-Id: I0d744cd48bb5a27e735fce3f6f740450d1f6a55a
2021-08-10skin engine: handle bitmap read errors appropriatelyAidan MacDonald1-2/+8
Change-Id: Ifab0e607cb71afbe26b9e508fe1db3a8730bad4b
2021-06-22Touchscreen: adjust how bar padding is handledAidan MacDonald1-12/+15
The old way of padding out bars was to just create a bigger touch region, the intent being to make it easier to touch the end of a bar. Unfortunately, this didn't even accomplish that, and caused an annoying offset between the bar graphics and the touch point. New method is to account for padding explicitly and clamp touches in the padding region so they are within the proper touch region. Change-Id: Id39e571fc1b033a4da94f0eb1143a2fc276bab03
2021-04-10Fix red in bc416ff590Solomon Peachy1-0/+1
Most of it was due to checkwps breaking, the rest was m68k with radios. Change-Id: I8a00e094e4006a132932f05e6c4ff7db63dfbfc8
2020-10-28fix checkwps build (introduced in a5a8e00)Solomon Peachy1-1/+2
Change-Id: Ibc8bced6721b3711e465320a537e15244b2b11b2
2020-10-28Fix a crash introduced in a605cdf70Solomon Peachy1-3/+5
Pretty subtle problem; looks like the skin core was relying on a destructor to actually help initialize things. Change-Id: Ieb4b9e4f11377dec7be61d13759590fc5f4bc921
2020-10-28Fix statusbar display regression from a605cdf700Solomon Peachy1-6/+6
Change-Id: I4d02ac28e05080458eea6e3f52498321199ecbd3
2020-10-28Fix multiple potential null pointer dereferencessSolomon Peachy1-17/+37
GCC's optimizer thinks all of these _will_ fail at some point Change-Id: I287eeb574162a5d3b3347654d25aa1f53e9f5563
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-4/+4
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-07-24[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.Solomon Peachy1-52/+1
Note: I left behind lcd_bitmap in features.txt, because removing it would require considerable work in the manual and the translations. Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24[2/4] get rid of HAVE_LCD_CHARCELLSSolomon Peachy1-8/+0
HAVE_LCD_BITMAP is now redundant. lcd_bitmap is always-on in features.txt so manual and lang strings don't have to change Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
2017-11-24Do playback restarts the proper wayMichael Sevakis1-16/+7
It isn't necessary to explicitly stop and restart playback to force it to update something that must cause rebuffering. Change-Id: I6ff5394fcafc7374af67ef9fbf9022bb4a79b773
2017-02-04Fix dangerous castsAmaury Pouly1-1/+1
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
2014-07-21add supports for x,y value in percentage to several tags.Chiwen Chang1-16/+100
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>
2014-06-29skin_engine: kill scrolling if the buffer movesJonathan Gordon1-0/+10
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>
2014-06-02fix indenting, editor went nutsJonathan Gordon1-8/+8
Change-Id: Ibe363e5c75260f50c6c6c6fc58a2758a7902ffc3
2014-06-02skin_engine: Don't double free buflib handles shared by skin imagesJonathan Gordon1-0/+12
Change-Id: I4158fb7dae664a746141f458c08bdcb84e148041
2014-05-18Also make sure progressbars don't tihnk their images are loadedJonathan Gordon1-0/+1
Change-Id: I83bb8e246e4858396ca0b5d0d90fbd2d08a88c1e