Commit graph

96 commits

Author SHA1 Message Date
Christian Soffke
ac9066dd44 Setttings: Eliminate gui_synclist_init_display_settings callbacks
Since synclists are now re-initialized after leaving
Settings menus where the callback was used, it
shouldn't be needed anymore.

gui_synclist_init_display_settings can also be made
local to list.c now.

Change-Id: I674e4da49153440b48298fed7c4d98b421b7beaa
2022-12-11 11:50:33 +01:00
Aidan MacDonald
c6ee9dc883 Limit exposure of skin engine internals
Drop wps_internals.h from skin_engine.h. The WPS and to a lesser
extent the radio screen are too tightly integrated to drop their
dependency on wps_internals.h, unfortunately. Skinned lists, for
obvious reasons, also need access to the internals.

Change-Id: I00a55aa423900f9ad22edccbe2fc1910af380e38
2022-10-17 14:29:12 +01:00
Aidan MacDonald
e57b4f9099 gui: Remove gui_synclist_item_is_onscreen()
Only the "Rockbox Info" screen uses it for a rather silly purpose,
so remove the function. This helps to decouple things from the GUI.

Change-Id: Icf73e3ee1230c75bf43016c0f1c05c7fe1a24895
2022-10-05 11:23:11 -04:00
Aidan MacDonald
1c5a0497cf gui: Remove list "limit_scroll" member
Get rid of the "limit_scroll" member from lists and make it a
local variable of gui_synclist_do_button().

Bump plugin API version since struct gui_synclist was changed.

Change-Id: Ie3244a85e5a1022a2f6e238a506fdbba67724962
2022-10-05 11:23:01 -04:00
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Aidan MacDonald
ff378deb69 gui: Remove gui_synclist_limit_scroll()
Since gui_synclist_do_button() overrides the setting at runtime
there is no reason to have a public API call to set it. Really
it should be a local variable, but it will be simpler to do that
after refactoring how list wraparound behavior is handled.

Change-Id: Id09d42197814102693752a9f64db8325118ca796
2022-10-05 11:22:34 -04:00
Aidan MacDonald
ead172c05d gui: Remove redundant copies of list scrolling settings
gui_list_screen_scroll_step() and gui_list_screen_scroll_out_of_view()
just copy the global setting into a local static variable.
Since they don't do anything special when the setting changes
it's simpler to use the global setting directly.

Change-Id: Ib6a7bf4e09b6dabbc1597cf28ddbafc0bc857526
2022-10-05 10:22:55 -04:00
Aidan MacDonald
9ce5b2a2ed gui: Remove show/hide selection option in lists
The implementation of the "show_selection_marker" option in
lists isn't great. It's a cosmetic option used to hide the
selection, but it causes the list to do funny things to the
selected_item and doesn't play nice with voiced menus, since
these rely on the selection to determine what item is spoken.

There are only two user-facing lists that use the option, the
"Rockbox Info" screen and a menu in the superdom plugin. The
rest are debug screens, and cosmetics don't matter much there.

Given how little used the option is, and its issues, removing
it seems reasonable.

Change-Id: I2c70b3e4c74ff3cc6dbac46366a371d271dd2d58
2022-10-02 09:21:25 -04:00
Aidan MacDonald
5b0506e9de gui: Constify list title text
Use const char* pointers for list titles. Only one debug menu
actually modifies the title, and in that case it's legal to
cast away const because the title points to a known mutable
buffer on the stack.

Change-Id: Idb8ab307b9a6ec23a93d8420c5e19fafd9f59c30
2022-10-02 08:20:10 -04:00
William Wilgus
ddcab156f7 gui_synclist move global display settings to list struct
its really painful needing to override global settings in order to change
some aspects of lists

this patch moves:

[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]

to variables within the synclist, it also makes updating
after settings changes a necessity

I think I have the static synclists in core covered

(I think the one in gui/list-skinned can be left as is)

this patch allows easy modification these flags on the fly

Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
2022-04-10 22:24:28 -04:00
William Wilgus
a7703e4926 gui lists add callback for owner drawn items
allow the guts of gui_sync_list to be used with owner drawn items

WIP

printcell_helper--

goal: allow data to be displayed in a spreadsheet format  with an easy to use interface

printcell_set_columns(gui_synclist, title, icon)
 sets title and calculates cell widths
 each column is identified by '$' character
 ex 3 columns title = "Col1$Col2$Col3"
also accepts $*WIDTH$
 ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
printcell_enable(gui_synclist, enable)
 sets the printcell function enabled

After setting the columns and enabling the printcell function
 items can be added to the list like normal
 column items are supplied delimited by '$'
 ex item = "Item1$item2$item3"
 they will be placed in cells defined by set_columns and scroll if the cell is too small

--Fixed for 1 bit & 2 bit displays

Change-Id: I49bd7903005d7a54e93af4379b0cdea63c860656
2022-01-01 23:56:51 -05:00
Aidan MacDonald
d1653bc4d8 touchscreen: fix smooth scrolling in lists
This fixes those annoying jumps that happen when you hit the end of
a list while scrolling.

Change-Id: I2e41111f9415dce1692b52a2600e7ce77c8f0291
2021-08-22 14:57:54 +00:00
William Wilgus
43f90746d5 synclist add method for setting selection color
Change-Id: I8c8761d92f4fc99f65d45098ee6e97800d3fe002
2020-11-14 00:01:39 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
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 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
4beafe16fa Show time, date, and recording directory in the info screen
Patch by Igor Poretsky

Change-Id: I5db0d018742c11dd9bf3ca4c9539cd91f94d4c2e
2019-07-28 14:57:14 +02:00
Cástor Muñoz
d20185ac96 iPod Classic: reads HDD S.M.A.R.T. data
Adds ata_read_smart() function to storage ATA driver, current
SMART data can be displayed and optionally written to hard
disk using System->Debug menu.

Change-Id: Ie8817bb311d5d956df2f0fbfaf554e2d53e89a93
2015-10-07 06:15:04 +02:00
Thomas Martitz
eec89a90ff lists: Adapt put_line().
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
2014-01-07 14:13:40 +01:00
Jonathan Gordon
69228f92db simplelist: Make better use of the static buffer and simplify API
Change-Id: I1327fcd01d6f817be6c7018d30d33446c9b57287
2013-02-12 21:01:13 +11:00
Frank Gevaerts
7151111228 Make touchscreen handling work with skinned lists.
Change-Id: I7df93319c8f16f05e840d74b022aab4803bb8f80
2012-06-19 22:02:59 +02: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
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
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
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
Thomas Martitz
5c509d17db Fix buttonbar and line padding in time&date screen.
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
2011-10-22 10:09:23 +00:00
Thomas Martitz
0acdc87df4 lists: Detect dirtyness (need to reinit) for each list, instead of once globally.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30721 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 17:22:49 +00:00
Frank Gevaerts
28d5f2aa57 Add "%LN" tag to retrieve the list item number of the current item. This allows e.g. putting item numbers in skinned lists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30568 a1c6a512-1295-4272-9138-f99709370657
2011-09-18 12:35:32 +00:00
Jonathan Gordon
3d0317a273 Rework how the skin gets the list item text to save some ram. Also allow the %LI and %LT tags to take 2 optional parameters to get a different items text/icon:
%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
2011-09-11 10:44:17 +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
Jonathan Gordon
573f2206c1 Add the list colour callback and a proper title icon to the simplelist api
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30419 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 13:24:56 +00:00
Thomas Martitz
b673ae2c46 FS#11686 - Kinetic list scrolling for touchscreen
This adds kinetic scrolling to to lists on touchscreen targets and RaaA, like all other OSes on touchscreens have.
It's only enabled in the absolute point mode, so for non-touchscreen and in grid mode nothing changes.

Kinetic scrolling means that the list keeps scrolling (but is decelerating) after you leave the touchscreen with the finger.
Redraw interval and deceleration is hardcoded for now but could be made configurable if desired.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28408 a1c6a512-1295-4272-9138-f99709370657
2010-10-31 11:11:46 +00:00
Thomas Martitz
f060cd5428 Don't actually reimplement an existing feature for hiding the selection marker
during scrolling.

However, the existing one is part of the list api, so it shouldn't be overridden
blindly internally, so do the decision in a different but equivalent way.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28147 a1c6a512-1295-4272-9138-f99709370657
2010-09-23 00:37:33 +00:00
Thomas Martitz
ac08e6942a Touchscreen: Improve scrolling in absolute point mode.
* Scrolling is now done by wiping over the screen. There's no acceleration or
  kinetic scrolling yet though. But it works rather well (previously
  you held the edges of the list to scroll).
* Improve scrollbar scrolling so that it keeps scrolling even if you leave the
  scrollbar area.
* Hide selection during scrolling
* Prevent accidental hitting of the list title (which means go back) during
  scrolling
* Don't go into context menu after scrolling when leaving the screen on an item

In general, it's very much like scrolling in native lists in Android,
except there's no kinetic scrolling and everything is still line based, but with
the feature that the scrollbar enables jumping around in the list and very fast
scrolling.

Thanks to Dustin Skoracki for his ideas and half of the code for this.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28145 a1c6a512-1295-4272-9138-f99709370657
2010-09-23 00:02:32 +00:00
Teruaki Kawashima
dafcd1470a remove unused fields from struct gui_synclist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24807 a1c6a512-1295-4272-9138-f99709370657
2010-02-21 13:32:52 +00:00
Teruaki Kawashima
d50c78c238 * surround member only used by charcells with #ifdef HAVE_LCD_CHARCELLS in struct scrollinfo in scroll_engine.h.
* remove function prototypes which are not actualy defined.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24693 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 11:59:37 +00:00
Teruaki Kawashima
93f9e7cbfb fix text scrolling handling in do_menu, set_time_screen and time_screen.
Don't scroll text in time_screen(). the lines will be redrawn before scrolling statrs, so they don't scroll anyway.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24591 a1c6a512-1295-4272-9138-f99709370657
2010-02-11 10:41:06 +00:00
Bertrik Sikken
44fa025d8f Use plain int (instead of char) for field selection_size in struct simplelist_info
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24188 a1c6a512-1295-4272-9138-f99709370657
2010-01-05 21:15:20 +00:00
Nils Wallménius
8e33c2f17f revert r23093 and r 23094, since the title pointer is used to modify the title of the list from the callback function in one place
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23096 a1c6a512-1295-4272-9138-f99709370657
2009-10-11 09:40:47 +00:00
Nils Wallménius
aa84a99caf Const correctness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23093 a1c6a512-1295-4272-9138-f99709370657
2009-10-11 09:09:20 +00:00
Thomas Martitz
2eb1cb6f82 Fix buttonbar handling/theme changed handling in lists.
The lists need to copy to a local parent if a list passes NULL as parent in the init. This was before the commit of custom ui vp, but I removed it since I (wrongly) thought using the ui vp as parent would be fine. Let the viewportmanager fire a event in case when a theme-related setting changed and simply the handling in the lists code.
However the buttonbar handling didn't work before anyway, since list code didn't know if the buttonbar was active (it asked a variable which was always false....).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22651 a1c6a512-1295-4272-9138-f99709370657
2009-09-07 17:37:06 +00:00
Nils Wallménius
3200d04d75 Make the formatter functions used by the settings return a pointer to avoid usless copying of lang strings, this brought with it a long chain of const correctness and a few random cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22440 a1c6a512-1295-4272-9138-f99709370657
2009-08-20 16:47:44 +00:00
Maurus Cuelenaere
567d83e6be FS#10534: Make scrollbar width variable through a setting (useful for touchscreen targets)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22387 a1c6a512-1295-4272-9138-f99709370657
2009-08-17 22:41:22 +00:00
Thomas Martitz
4c48b59be8 User definable UI viewport, to be able to restrict the UI into a viewport for all bitmap displays.
Flyspray: FS#8799

This will allow for pretty themes, for example those with nice glass effects on their backdrops (some might argue they're wasting screen space but it's upto them),
as well as allowing for future background WPS updates in the main UI.

Plugins are not converted yet, they simply use the full screen. Ideally, any plugin that does *not* want the UI viewport, should take care of that itself (i.e. plugins should normally use the UI viewport).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22365 a1c6a512-1295-4272-9138-f99709370657
2009-08-16 22:20:11 +00:00
Bertrik Sikken
d767883a41 Various files: make functions static if they're local or make sure there is a proper #include if not
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22184 a1c6a512-1295-4272-9138-f99709370657
2009-08-06 09:28:25 +00:00
Nils Wallménius
0a51d3915c Remove redundant definitions of SCROLLBAR_WIDTH
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22114 a1c6a512-1295-4272-9138-f99709370657
2009-08-02 15:44:40 +00:00
Andrew Mahone
1bc67c81b6 Fix type mismatch warnings and errors exposed when building with EABI toolchain.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21769 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 00:22:26 +00:00
Jonathan Gordon
e385ee18ce Decouple the statusbar drawing from the rest of the screen drawing. it is not drawn roughly 4x per second automatically.
viewport_Set_defaults() will setup the given viewport with the correct "full screen" dimensions (so start at 0,0 if statusbars are disabled or 0,8 if they are enabled.)
All screens should keep the statusbar enabled, but if you really want to ignore the user setting you can disbaled it with viewportmanager_set_statusbar(false).

This commit also includes some menu/list viewport cleanups from kugel in FS#9603


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19622 a1c6a512-1295-4272-9138-f99709370657
2008-12-31 05:59:26 +00:00
Jonathan Gordon
2438d7881a redo the previous commit so its actually useful.
if the callback returns ACTION_STD_CANCEL when the user presses ACTION_STD_OK the simple list will exit and set the selection. Otherwise, when ACTION_STD_CANCEL happens the selection will be set to -1


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18641 a1c6a512-1295-4272-9138-f99709370657
2008-09-25 08:12:25 +00:00
Jonathan Gordon
67df5f2434 have the info lists set the selection before they are exited, this is sometimes needed by the caller
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18640 a1c6a512-1295-4272-9138-f99709370657
2008-09-25 07:56:34 +00:00
Jonathan Gordon
311d048f6f fix FS#9144 hopefully for good... only update the screen if the time line is selected, or if talking menus are disabled, only update if the time line is actually on the screen. Also only update every 5s so scrolling lines still scroll. (turns out scroll_all was broken! fixed now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17944 a1c6a512-1295-4272-9138-f99709370657
2008-07-05 12:31:04 +00:00