Commit graph

1578 commits

Author SHA1 Message Date
Jonathan Gordon
014a08cabb skin_engine: New tag to draw a rectangle (optionally with a gradient)
%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
2012-03-15 22:52:53 +11:00
Jonathan Gordon
f31e7a1225 Revert "Fix FS#12606 - next track can cause the screen to be cleared"
This reverts commit cb9bc3bbc8.
2012-03-15 11:31:18 +11:00
Jonathan Gordon
cb9bc3bbc8 Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine
is doing a full redraw (which means fullscreen clear) before the
lcd_update() to give the current screen a chance to redraw to avoid the
screen flicker.

This commit fixes the issue for screens which are entirely the list
widget (i.e browser and menus), other screens will need aditional fixes
(i.e quickscreen, time&date screen)

Change-Id: I3ffdcd8ccad2c663732f8d5983049c837de00fe5
2012-03-14 22:52:24 +11:00
Osborne Jacobs
595427c095 Add new actions to %Tp (Touchscreen areas)
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>
2012-03-13 03:17:12 +01:00
Frank Gevaerts
4fbbbf1360 Make %LC and %LR always have predictable and usable values.
%LC is now 1 for non-tiled list items (instead of undefined)
%LC and %LR are now -1 in non-list contexts.

Change-Id: Ib7090429fa95528bd141d3d7ca95fd917b25b96e
2012-03-01 18:40:59 +01:00
Frank Gevaerts
b9bf6cdb2c Call skinlist_set_cfg() unconditionally, i.e. also if do_refresh==false
This call is cheap (except if the list config changes, but then it should
be called anyway), and do_refresh isn't always set appropriately, e.g.
when the screen has just changed, which could cause the list config to be
null at bad times, which caused the standard list to be shown instead of
the desired skinned list.

Change-Id: I47dd2552d6d1062456ede4529c4891e80a8159ea
Reviewed-on: http://gerrit.rockbox.org/113
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2012-02-29 14:11:33 +01:00
Jonathan Gordon
d96a32d01a fix warning
Change-Id: Iccadc7558b9ffb2d87e5bc7697080dd567f4775f
2012-02-29 00:18:56 +11:00
Jonathan Gordon
1c1e1c070c skin_engine: ease the restrictions on %x/%xl
%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
2012-02-29 00:14:06 +11:00
Jonathan Gordon
34031cba5b skin_engine: Clean up %x() handling - beware theme issues
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
2012-02-28 23:51:01 +11:00
Jonathan Gordon
0807fe8d36 Fix build errors
Change-Id: Ie46e807799034af2a025c607a76e17c50c5b613e
2012-02-28 23:16:06 +11:00
Jonathan Gordon
2c71aa9feb lcd/skin_engine: Add the ability to draw onto the backdrop layer
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
2012-02-28 23:03:04 +11:00
Frank Gevaerts
077e8b61a0 Clean up some variables.
Renames origional_* variables to original_*
Removes original_(width,height) variables that weren't actually used

Change-Id: I604c2ef9ce9d806551e8c52080a5c895415e088c
2012-02-25 22:04:20 +01:00
Frank Gevaerts
b5cd5ce8a1 Add %LR and %LC to get at the current row and columm in skinned lists.
This allows list items to be rendered differently depending on their
on-screen position, allowing things like gradients or nonlinear alignment

Change-Id: I1d9c080f97e83707f0e80f57abc762cb2b94f6ed
2012-02-25 16:43:27 +01:00
Jonathan Gordon
31a05953e1 FS#12586 - Modify %ss to be able to use numbers for conditionals
i.e %?ss(1,1,%cM)<|one|two|three|...|> or %xd(numbers, %ss(1,1%cM)

Change-Id: I74ecb3f253f3be1fd270f75c0ef79addd364a7de
2012-02-26 00:50:14 +11:00
Frank Gevaerts
680c6fcde1 Store listitem_viewport_cfg->label as skinoffset instead of raw pointer
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>
2012-02-22 01:15:42 +01:00
Frank Gevaerts
1a4da5961e Make skinned lists handle the "0 items" case without crashing
Change-Id: Iaf69c93727e0f0e2a48b44c330883f7a620c4d99
2012-02-21 01:29:12 +01:00
Jonathan Gordon
9c21258e2c skin engine: Add 'touch' command to the %vs() tag
%vs(label, touch, -) will reset the timeout for the variable without
changing the variables value.

Change-Id: Idba03f454a82ac7460bb53a4de3aa6903656c585
2012-02-21 00:34:58 +11:00
Jonathan Gordon
43fc2a51d9 skin engine: Make %vs() dynamic so it updated every screen update
This makes it easier to use %?vl() (variable last changed) in a sensible manner.

Change-Id: I0bf9ae24bc4516d2fd5691af236cc4439a0863c8
2012-02-21 00:17:49 +11:00
Frank Gevaerts
9c3ce33d4e Fix another skinned list buflib issue
Change-Id: Ib0eebf56b1bf4f4119ebfd21679f6cd9c8986ea4
2012-02-19 21:06:03 +01:00
Frank Gevaerts
46285e7c2f Fix a nullpointer dereference in skinned lists.
Unfortunately this doesn't seem to be the only problem with skinned
lists. Fixing this still doesn't make them work right.

Change-Id: Ibf80eb2a4fa4eb392e2f3ea9744aec68c6181961
2012-02-19 20:52:06 +01:00
Bertrik Sikken
f81100efd2 make local variable current_list static
Change-Id: Ibe3536a4865c12160e933d3696af4b5507713ffe
2012-02-19 12:12:40 +01:00
Jonathan Gordon
a2f28452e1 Fix FS#9391 - playback engine gets confused by multiple simultaneous button presses
Change-Id: Ie08f9dabc814adfe92c382d2e770808839cd6dd2
2012-02-07 22:06:09 +11:00
Jonathan Gordon
40ecdf6811 skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a single conditional.
Use these tags to stop having multiple conditionals.. e.g:
OLD: %?C<%?Ia<something>>
NEW: %?and(%C, %Ia)<something>

Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
2012-02-07 21:41:18 +11:00
Thomas Martitz
54044fd6e9 Apply "Skip to outro" and specific skip lengths to individual tracks in a cuesheet.
Previously it applied to the whole file and you couldn't skip betweenn the
subtracks. Now it behaves consistently with real seperated tracks.

Change-Id: Ic1730ace142a05d9726b8c9afd67e94823651b60
2012-01-30 21:25:31 +01:00
Jonathan Gordon
a65d241dd0 skin touchregions: change the rwd/ffwd region actions to make it less buggy in the sbs
Change-Id: Ib823860e65909ac227910a16f6caac207b7e22c3
2012-01-28 23:38:16 +11:00
Jonathan Gordon
8a3af26364 skin touchregions: fix the 'none' region firing when it shouldnt.
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
2012-01-23 07:42:28 +11:00
Jonathan Gordon
eb2ea7f9ad keyclick: Add a callback so screens can cancel a click. Add a generic list callback to stop clicks when we are at the end of the list
Change-Id: Iabb44a861dd7506cd883c1bdb0241303fa646746
2012-01-12 22:28:36 +11:00
Rafaël Carré
b612263b1e apps: lcd-remote.h is not needed if HAVE_REMOTE_LCD is not defined
Fix a comment

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31608 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 19:35:46 +00:00
Thomas Martitz
c1bd9b0361 Rework powermgmt to enable code re-use on appliation and sims.
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application)
to break powermgmt.c's assumption about the ability to read battery voltage.
There's now additionally percentage (android) and remaining time measure
(maemo). No measure at all also works (sdl app). If voltage can't be measured,
then battery_level() is king and it'll be used for power_history and runtime
estimation.

* Implement target's API in the simulator, i.e. _battery_voltage(), so it
doesn't need to implement it's own powermgmt.c and other stubs. Now
the sim behaves much more like a native target, although it still
changes the simulated battery voltage quickly,

* Other changes include include renaming battery_adc_voltage() to
_battery_voltage(), for consistency with the new target functions and
making some of the apps code aware that voltage and runtime estimation
is not always available.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2012-01-03 23:44:38 +00:00
Jonathan Gordon
7949dd4dae protect the yes/no screen from extra keypresses (which can happen if you display 2 yes/no screens too quickly)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31452 a1c6a512-1295-4272-9138-f99709370657
2011-12-28 05:55:05 +00:00
Bertrik Sikken
e6c85a6735 local variable app/gui/icon.c/iconsets can be made static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31386 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 21:05:56 +00:00
Bertrik Sikken
cb972abc48 Another round of making local functions static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31384 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 20:35:28 +00:00
Boris Gjenero
fdc29d0ea4 Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
2011-12-19 20:12:52 +00:00
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
13f1b08388 Allow scrolling lines to have their content changed without restarting the scroll line. This means skin lines with dynamic tags can be updated in realtime instead of delayed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31247 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 12:53:19 +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
a55982d130 Fix touchscreens so entering the WPS with a skin with no touchregions reverts to grid mode (caused by r30991)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31156 a1c6a512-1295-4272-9138-f99709370657
2011-12-06 10:30:13 +00:00
Boris Gjenero
694502a965 Fix FS#12423 : Rockbox access to /.rockbox/fonts after usb_enable(true). This fixes entry into USB mode on the Archos Recorder V2 and possibly also other targets using a USB to IDE bridge chip. Fred Bauer found this removes the need for a workaround in glyph_cache_save(). I'm including his patch which removes the workaround.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31155 a1c6a512-1295-4272-9138-f99709370657
2011-12-06 00:58:01 +00:00
Boris Gjenero
d51e598335 FS#12412 : Delete old buffer allocation code which has been replaced by core_alloc, and move buffer setup code to core_alloc.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657
2011-11-29 00:42:27 +00:00
Jonathan Gordon
8ed7ba1d7b Fix fs#12005 - have %pc,%pl and %pr return the number of seconds when used with %if() instead of a formatted time string
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31082 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 11:16:01 +00:00
Jonathan Gordon
d66592bad1 Be less smart about when to reload skins as it caused more problems than it was worth. If any theme setting is loading from a .cfg reload all skins. Fixes FS#12410
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31081 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 10:58:15 +00:00
Jonathan Gordon
25bce232f2 Fix FS#12408 - don't load skins too early causing buflib handles to leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31080 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 10:44:16 +00:00
Jonathan Gordon
fc5cdacafd slightly reaarange code to make fml happy :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31071 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 13:57:18 +00:00
Jonathan Gordon
494860cfd4 Free a handle when we try to load a backdrop file which doesnt exist or cant be loaded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31070 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 11:50:07 +00:00
Jonathan Gordon
6cf7cb9822 Don't load the icons unless show_icons is actually enabled. And respect that setting in the shortcuts menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31069 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 10:10:26 +00:00
Jonathan Gordon
080a746ce3 Fix the charcell compile error and rmeove an unused #define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31039 a1c6a512-1295-4272-9138-f99709370657
2011-11-21 10:08:34 +00:00
Jonathan Gordon
f78bcb165f skinengine: Load the fms the first time the fm screen is entered instead of on boot to save some ram
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31038 a1c6a512-1295-4272-9138-f99709370657
2011-11-21 10:03:36 +00:00
Jonathan Gordon
0ca4b38b1b skinengine: Rework skin loading so skins can be un/loaded individually. This 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
2011-11-21 10:02:23 +00:00
Fred Bauer
fdfc88f38b Rename global_settings member glyphs to glyphs_to_cache and add descriptive comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31032 a1c6a512-1295-4272-9138-f99709370657
2011-11-20 15:41:17 +00:00
Fred Bauer
ea7a89606c FS#12293 Global default glyph setting in System > Limits > Glyphs To Cache. 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
2011-11-19 23:34:26 +00:00