add_event_ex is added that takes an extra user_data pointer. This pointer is
passed to the callback (add_event and add_event_ex have slightly different
callbacks types). All callbacks also get the event id passed. Events added
with add_event_ex must be removed with remove_event_ex because the user_data
pointer must match in addition to the callback pointer.
On the other add_event is simplified to omit the oneshort parameter which
was almost always false (still there with add_event_ex).
As a side effect the ata_idle_notify callbacks are changed as well, they
do not take a data parameter anymore which was always NULL anyway.
This commit also adds some documentation to events.h
Change-Id: I13e29a0f88ef908f175b376d83550f9e0231f772
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>
This patch adds a configurable line separator between list items, very
similar to lists in Android. Additionally, below the list item there is a
thicker line. It can be disabled in the settings. Its color can
be configured as well.
Remote and monochrome displays are explicitly unsupported. If there is desire
this can be changed but it doesn't seem useful to me.
Change-Id: I005313b0d8f5ecd15864bf20e66ea4e3390d8b7d
Since eec89a9 icons have been centered using same calculation as for fonts.
In edge cases this is visually different from before and didn't align
well to the font's baseline. Revert to the old calculation just for centering
icons to fix.
A proper aligorithm would take the baseline into account but this has
worked sufficiently well for us (fix this if needed)
Change-Id: I86593529b16cd28ae4552641e216e73795f2450c
When skins use the default backdrop (via %X(-) or no %X at all) and the setting
changes it needs to be reloaded, otherwise when changing themes the new theme
could show the backdrop from the previous theme. The same needs to be
done when re-selecting the same theme after USB because the backdrop file was
potentially overwritten.
Fixes FS#12892 and FS#12942.
Change-Id: Ic2d20740cc385fa99667ce8a71507dbda2efceaf
If the UI viewport is too small only the most top/left parts of the logo will
be displayed. This goes one step further than bac85f2.
Change-Id: I832b0e787e57e3b102a9c097cf1cccd7d4ad92d9
Fonts can now be assumed (by the code) to be available during USB. Make
use of this fact in the USB screen and don't disable the skins.
Change-Id: I525359aae16660604e8fe89addc0bdf97a3fafc1
When changing activities (those that are indicated via %cs skin tag), the sbs
needs to be updated, so that the UI viewport can be applied before that
activity draws its UI.
Fixes FS#12804. I hope this commit doesn't have bad side effects.
Change-Id: If45654e356749f5f27991430dbd1da6f23e6f802
This fixes displaying of the main USB screen on m:robe 100. A remote for
this particular target has no native remote USB logo and it uses a larger
one. However it's a good idea to perform this check always IMHO.
Change-Id: I56ceb2316c551269be011b60271d8da11cb8b073
Add a "volume limit" parameter to the configuration file. The maximum
value of volume setting in sound menu will be limited to the same as
volume limit. Also each time when setvol() is excuted, Rockbox will
check if the global_settings.volume value larger than
global_settings.volume_limit. If larger, take the value of volume_limit
instead. The volume_limit argument shares the same maximum and minimum values
with volume argument, while taking the maximum volume as its default value.
Change-Id: I8ca9bc6ea6e617b48fc346aae5f2a0a1d259ae36
Reviewed-on: http://gerrit.rockbox.org/697
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
At the end of the format string it wrote a last byte (or inline string) past
the end of the lcd boundaries, potentially overwriting unrelated memory. It
now makes sure it won't exceed the viewport's width.
Change-Id: Id4cfce918e8b070b7fc3c7d33f389f7a171963ff
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
Allocate MAX_LINES+1 because at the time get_line_desc() is called
the scroll engine did not yet determine that it ran out of lines
(because puts_scroll_func() wasn't called yet. Therefore we can
run out of lines before setting the used field. By allocating
one item more we can survive that point and set used to false
if the scroll engine runs out of lines.
Change-Id: I7a9af1bce256c6e07d254f096bd5865fa7cf2cee
With the new lcd_putsxy_scroll_func() code can register custom scroll functions
(put_line() makes use of that). In order for the custom scroller to be able
to properly manage its userdata pointer (set via struct scrollinfo::userdata)
the scroll engine must inform the scroller about start and stop of scrolling.
To inform about start the lcd_scroll_* functions now return true when
the line will scroll. To inform about stop the scroll engine calls into the
scroller one last time, with the text set to NULL.
put_line() can use this to release the userdata registered per scrolling line
so that it can be recycled.
This fixes that some scrolling lines became glitchy after some time because
the userdata was recycled too early.
Change-Id: Iff0a6ce2a4f9ae2bada1b8e62f4f5950224942a9
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
Because inline strings have to be copied (to escape '$') the local buffer
can be exhaused. The code didn't check for this. The buffer is increased
to handle filenames plus some extra chars but truncates to avoid overflow.
If you have longer strings please pass them via $t tag, in which case
put_line() imposes no additional length-limitation.
Change-Id: I0ca20adbe72f6d44cb442f34d665c16b12cbbaeb
put_line() needs to change fore- and background colors if required by
the line style. This should really only be done if required, and be undone
as to not compromise subsequent lines. This fixes %Vf and %Vb skin tags.
Change-Id: I85e5a0d1d64aa9eb76a891d9ce1de1320274a69a
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
This logic is moved into apps (put_line()) which can better handle line
decorations with respect to scrolling, mulitline and other complications.
Firmware doesn't need this. The remaining drawing function know only one style,
that is foreground on background/backdrop (changing drawmode is still supported).
Change-Id: I707060edc388a7d723a7d09b0cf5cbda6ec56708
Since scrolling is now pixel-based this is not necessary anymore. custom line
height is handled by put_line() but can also possible to implement with
lcd_puts_scroll_func().
Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
This enables removing large portions of code, simplifiyng the drawing routine.
All of the removed code is functionaltiy now available through put_line().
Change-Id: Ib8e61772134189a8c3c6d22345c0b45e912bea76
This function is a fully-fletched, high-level pixel-based line printer, that
combines functionality of several firmware and list functions. It can
draw spacing, icons and text in a single call, in any order and each multiple
times. It can also apply line decorations at the same time.
It features printf-like semantics by accepting a format string that contain
format tags as well as inline text.
It's accessible directly, but also through the multi-screen api for plugins.
Change-Id: I70f5a77bbf4b0252521f2e47ead377b9d6d29b54
This is needed by the upcoming put_line() api to apply different drawmodes
depending on the format.
Change-Id: I626a7369a6e75c9c46af1ca5e4f1a9d401899b68
Since x is viewport-relative the icon isn't necessarily placed at the physical
display boundaries so that the padding isn't always useful. In fact it does
more harm if one wants to place an icon exactly at 0 of a (non-default)
viewport.
Calling code looks still mostly fine. I've only modified list drawer to include
the padding in the call-site.
Change-Id: I6b16b3d4377c3553234667b79837adde10e0edf2
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.
As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.
Change-Id: I52123012208d04967876a304451d634e2bef3a33
Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c,
a small scroll callback routine remains. This callback can potentially be
overridden by more extensive scrollers.
The callback also gets fed with pixel-based scrolling information, which
finally removes the strict line-based nature of the scroll engine. Along with
this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect()
which works on a pixel-based rectangle instead of lines.
The ultimate goal is to move most of the scroll work to apps, which can
much better decide which line decorations to apply etc. This work is laying
the ground work.
Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
* Remove explicit tracking of elapsed time of previous track.
* Remove function to obtain auto skip flag.
* Most playback events now carry the extra information instead and
pass 'struct track_event *' for data.
* Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes
it cleaner and removes the struct mp3entry.
Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
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>
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
Fix the need to resize progress bar when using a slider.
Slider stays in bounds. Progress bar is not resized.
Works well with square sliders that should not overlap
edge of progress bar. also works with rounded sliders.
You can also make progress bar the full width of screen
while using a slider. Before if you would make the
progress bar the full width of the screen and add a slider
the progress bar would look like it was padded on both ends.
This fixes FS#12823
Change-Id: I60345efc5cd0f46286f2591ed032f0d9320d1c3e
Reviewed-on: http://gerrit.rockbox.org/402
Reviewed-by: Hayden Pearce <saint.lascivious@gmail.com>
Tested-by: Hayden Pearce <saint.lascivious@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
It fixed a simulator warning in the skin debug screen but broke
the icons in the database folder chooser. Proper fix shortly.
Change-Id: If366daacc440f937c40960112477b8f6136b72b9
There were some bugs, especially when the user scrolled above the
list viewport. One bug made Rockbox completely unusable once triggered.
Change-Id: I9bb4722ff4381db189058e9a19ea30b2c69e87d9
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
With radioart enabled there appears to be buffer corruption when
the image is loaded causing the player to data abort in skin_render_line()
So, disable the code untill someone can fix it.
Change-Id: I6acf3f76ce38aa2784b1b24ed6da29a9c5bee479
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
Keeping the touchscreen pressed during a screen transition can lead
to accidental actions. action_wait_for_release() currently doesn't work
properly for touchscreen, so it's better to not transition before release.
Change-Id: I37bd67945b05fff1b4a5452313f6415a247e3af9
with no button pressed.
If e.g. two yesno screens directly follow each other the button release of the
first one was incorrectly accepted in the second one. The fix exposed another
problem in action.c if action_wait_for_release() is called when no button is
actually pressed. The next press was silently eaten.
This time re-introducing FS#12723 is avoided by leaving the offending hunk
out in yesno.c.
Change-Id: Icfe57375067f51f5c8177f3585cd47ceec9dcf0d
USB mode to make sure the filedescriptor is correct.
Change-Id: I2905eaf27533d935a0458b630372584e353c7160
Reviewed-on: http://gerrit.rockbox.org/294
Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
Doing a LONG PRESS on a:
- unopened folder will select all its sub-folders
- opened folder will invert the selection of its sub-folders
Change-Id: Ia7fd8dc3b940f60adee3f0314bf6bba5eb2c7b3b
The browser lets the user pick one or more directories in a convinient
GUI browser. The initial directory list is read from a string
(separated by colons) and the resulting list is written back to the same
string (again separated by colons).
Note: The work was initially done by Jonathan Gordon, however I changed
it substantially so I claim autorship.
This selector is going to be used for autoresume and database scan folders.
Change-Id: Id1d3186dad783411eb5c6056ce93f5b6123c7aa0
%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>
Change-Id: I1583371228ed477b504c135f81cb59a0c3c931e6
Reviewed-on: http://gerrit.rockbox.org/296
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
Tested-by: Jonathan Gordon <rockbox@jdgordon.info>
If two yesno screens directly follow each other the button release of the
first one was incorrectly accepted in the second one. The fix exposed another
problem in action.c if action_wait_for_release() is called when no button is
actually pressed. The next press was silently eaten.
Change-Id: Iaa5f246f7ea1fd775606620a989cdaec74a9305e
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
Thiskin refresh trigger apparently causes the skin and list to continuously
refresh, with the side effect that buttons no longer work.
Change-Id: I4439406176890ac46a3f217bfff43c6935a03a7c
Reviewed-on: http://gerrit.rockbox.org/240
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
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
Also move the definition to config.h
Change-Id: I36bb5020c5e06b2344292bc05e8c13ccc7a6a1ff
Reviewed-on: http://gerrit.rockbox.org/234
Reviewed-by: Nils Wallménius <nils@rockbox.org>
- 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()
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
Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h.
Intermediate functions in misc.c handle any adjustment and calling
the rbcodec APIs.
Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024
Reviewed-on: http://gerrit.rockbox.org/140
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Creates a standard buffer passing, local data passing and messaging
system for processing stages. Stages can be moved to their own source
files to reduce clutter and ease assimilation of new ones. dsp.c
becomes dsp_core.c which supports an engine and framework for effects.
Formats and change notifications are passed along with the buffer so
that they arrive at the correct time at each stage in the chain
regardless of the internal delays of a particular one.
Removes restrictions on the number of samples that can be processed at
a time and it pays attention to destination buffer size restrictions
without having to limit input count, which also allows pcmbuf to
remain fuller and safely set its own buffer limits as it sees fit.
There is no longer a need to query input/output counts given a certain
number of input samples; just give it the sizes of the source and
destination buffers.
Works in harmony with stages that are not deterministic in terms of
sample input/output ratio (like both resamplers but most notably
the timestretch). As a result it fixes quirks with timestretch hanging
up with certain settings and it now operates properly throughout its
full settings range.
Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734
Reviewed-on: http://gerrit.rockbox.org/200
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
* fix potential stack overflow through recursion
* fix using using the scrollbar during active kinetic scrolling animation
Change-Id: Iaf124970a60d3f0c2ee7919ac278f2d6ac329e47
The old code was very confusing. The scrolling modes need to be handled
differently, thus a state machine makes sense. Should fix numerious
glitches and be easier to maintain.
NOTE: Behavior is still a bit glitchy with an SBS in use, because the skin
engine sees the touch events earlier than the list code.
Change-Id: I4ccead359c81de0d0fc3dea636fe2cb3a28d1bc6
The scrolling code cannot differentiate between the BUTTON_TOUCHSCREEN post
from normal touches and the one posted in the timeout callback.
To fix introduce a global special button (BUTTON_REDRAW) that results
in the desired redraw. This existed already as a local kludge for android
and is now generalized.
Change-Id: I6bfa6c66431c48f5042fcd8fce2ea72cd3457f58
Adds an option under settings > general settings > system to allow
the user to have the shortcuts menu displayed instead of the
quick screen. (option is "shortcuts instead of quickscreen" in the .cfg)
Change-Id: Id679b461c40ac617629422736d1509384364084d
Reviewed-on: http://gerrit.rockbox.org/199
Reviewed-by: Marek Salaba <marek.salaba@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
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: I3725c51518be724ce7aacee9877663c2de6866fa
%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
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
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>
%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
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>
%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
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
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
Renames origional_* variables to original_*
Removes original_(width,height) variables that weren't actually used
Change-Id: I604c2ef9ce9d806551e8c52080a5c895415e088c
This allows list items to be rendered differently depending on their
on-screen position, allowing things like gradients or nonlinear alignment
Change-Id: I1d9c080f97e83707f0e80f57abc762cb2b94f6ed
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>
%vs(label, touch, -) will reset the timeout for the variable without
changing the variables value.
Change-Id: Idba03f454a82ac7460bb53a4de3aa6903656c585
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
Use these tags to stop having multiple conditionals.. e.g:
OLD: %?C<%?Ia<something>>
NEW: %?and(%C, %Ia)<something>
Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
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
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
* 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
Now all threads need to ack the connection like on real target, dircache is unloaded and playback stops accordingly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31009 a1c6a512-1295-4272-9138-f99709370657
If the tag being checked returns a number as a string (i.e %pv) but doesnt set the intval try to convert the string to a number so the comparisson operators work
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31003 a1c6a512-1295-4272-9138-f99709370657
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
This allows to directly draw generated and builtin images using lcd_bmp(bm_xxx);
Also fixes builtin list icons on non-mono targets, as they didn't have the
format field set.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30971 a1c6a512-1295-4272-9138-f99709370657
cppcheckout reported:
[apps/gui/skin_engine/skin_tokens.c:1553] -> [apps/gui/skin_engine/skin_tokens.c:1553]: (style) Same expression on both sides of '||'.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30964 a1c6a512-1295-4272-9138-f99709370657
You can now use 32bit icons in lists and skins
(except album art, but can be added if wanted). The code also shows how
to free the unused alpha channel data if the bitmap doesn't actually contain
such information.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30939 a1c6a512-1295-4272-9138-f99709370657
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
The loaded flag wasn't set and skin_backdrop_show() call was missing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30846 a1c6a512-1295-4272-9138-f99709370657
The time&date screen uses a custom parent for do_menu(), and doesn't
account for the buttonbar and list line height. Introduce
gui_synclist_set_viewport_defaults() to set those for viewports that are
going to be list parents and use that so that time&date screen doesn't need
to know about buttonbar/line padding.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30824 a1c6a512-1295-4272-9138-f99709370657
This adds line padding to lists on touchscreens,
in order to make lists reasonably useful without huge fonts.
It's configurable:
* Automatic (default, line height calculated using a lcd dpi aware function)
* Off (status quo, line height = font height)
* X pixels (from 2 to 50 in even steps)
The automatic setting should/aims to Just Work Out Of The Box on all targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657
Since recent skin engine related commits images aren't stored on the skin
buffer anymore. The buffer was decreased accordingly. Now some themes used that
buffer more for tokens than images and are now broken.
To fix, increase the max token count, while optimizing the two most often
allocated structs for size (so no net ram usage increase).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30762 a1c6a512-1295-4272-9138-f99709370657
It's not clear whether a user setting is the right/accepted fix for the skin buffer.
But even if it is, this implementation of it is considered bad, even by the author.
See http://www.rockbox.org/mail/archive/rockbox-dev-archive-2011-09/0054.shtml
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30718 a1c6a512-1295-4272-9138-f99709370657
Currently the default size is 80KB on colour targets which can be way too much or not enough for users.
The format of the /.rockbox/skin_buffer_size.txt file is simply a number (so 120 if you want 120 kilobytes), NO trainling spaces or text of any kind
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30599 a1c6a512-1295-4272-9138-f99709370657
%LT(offset, nowrap) - get the text for the "being drawn"+offset item (offset being + or -). if the second param is "nowrap" (Without quotes) the text will be blank if the item would need to wrap. Same for the icon
e.g:
%LT(-1)
%LT <<
%LT(1, nowrap)
will display:
Four
Five <<
Six (or nothing if Five is the last item)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30502 a1c6a512-1295-4272-9138-f99709370657
%ss(start, length, tag) - i.e %ss(0,1,%TL) will get the first letter of the current lines text.
use - for the length to get the rest of the tag (e.g %ss(1,-,%TL) will get everything after the first letter).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30500 a1c6a512-1295-4272-9138-f99709370657
The usefulness of this is arguable, but this improves consistency at only a very small cost
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30491 a1c6a512-1295-4272-9138-f99709370657
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
The buflib memory allocator is handle based and can free and
compact, move or resize memory on demand. This allows to effeciently
allocate memory dynamically without an MMU, by avoiding fragmentation
through memory compaction.
This patch adds the buflib library to the core, along with
convinience wrappers to omit the context parameter. Compaction is
not yet enabled, but will be in a later patch. Therefore, this acts as a
replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug
menu.
See buflib.h for some API documentation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
%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
check the manual...
%Tl(..., &action) -> %Tl(..., action, repeat_press)
%Tl(..., *action) -> %Tl(..., action, long_press)
%Tl(..., !action) -> %Tl(..., action, reverse_bar)
and a new allow_while_lock to make the region fire when softlocked
these options must all be after the action name, but otherwise the order doesnt matter. And for the setting_inc/dec/set action the setting name must follow the action name, *then* the options
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30219 a1c6a512-1295-4272-9138-f99709370657
Modify the %Tl() tag to add a new region 'lock' which will lock/unlock the wps/sbs from touches (hardware buttons still work)
You can also specify a region to work when locked by prepending ^ to the action name (this is probably about to change though)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30218 a1c6a512-1295-4272-9138-f99709370657