Commit graph

57 commits

Author SHA1 Message Date
William Wilgus
88f6628423 consolidate bmp_read function between icons and skin_parser
uses fd now rather than opening file twice

Change-Id: If35418cbc77adacf5e96fb6aa0fc8ffef2fffcbd
2022-12-20 19:07:46 -05:00
William Wilgus
3745c813f9 misc.c open_pathfmt caller supplied buffer
Amachronic raised concern about open() blocking causing a static buf
to get overwritten in multiple calls its prudent to just have the caller
supply the buffer to minimize stack issues later

Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a
2022-11-23 22:09:46 -05:00
William Wilgus
e7e20fab1b create function open_pathfmt() to allow printf formatting on open()
save some space by allowing printf formatting directly rather than
having a buffer and using sprintf

Change-Id: I049c8f898fb4a68a26ad0f0646250c242647ba12
2022-11-19 23:13:42 -05:00
Aidan MacDonald
1718cf5f8a Convert a number of allocations to use buflib pinning
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-16 14:50:39 +01:00
William Wilgus
eafdba87f8 icon.c bug fix handle read errors
read errors are negative buf_sz was a unsignbed int

Change-Id: I45ba67e09ce54ff09411248340ba2c9c62c57583
2021-08-15 11:27:30 +00:00
William Wilgus
36e48a8bb2 icon.c guard against negative error values bytesread is copied to an unsigned int for core_shrink
Change-Id: Iff93397e7d6fae8936ef0fdbb1e71df63bcf6531
2021-08-02 23:06:40 -04:00
Solomon Peachy
bc416ff590 misc: Only include rbpaths.h and string-extra.h in places that need it
(Don't include rbpaths.h in settings.h, or string-extra.h in rbpaths.h)

Build-tested on rocker, erosq, mini2g, nano2g,
                xduoox3, clipzip, dx50, and uisim

Change-Id: If32e9c9910f5c8247a655cb64522b84d6d7ccbb5
2021-04-10 12:08:12 -04: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
William Wilgus
5afdcdd460 Bug fix icon.c crashes with negative icon index
The index for Icon_NOICON is -1 which is caught properly
as is icon > Icon_Last_Themeable

But if you pass an index lower than Icon_NOICON screen_put_iconxy()
tries to read memory prior to the iconset resulting in a crash

Change-Id: I415e650932d65214d883a1595e22261f22e776b6
2019-09-24 23:51:12 -05:00
Thomas Martitz
5d37d2579a icons: When loading mono icons keep them in mono format.
This enables monochrome icons them to work with the invert line selector.

Change-Id: Ic3e9219e93b4879166a10180e6067446a84a62bf
2014-01-11 14:19:43 +01:00
Thomas Martitz
5752d029fd icons: Provide accessors to the icon format (mono or native).
This is needed by the upcoming put_line() api to apply different drawmodes
depending on the format.

Change-Id: I626a7369a6e75c9c46af1ca5e4f1a9d401899b68
2014-01-07 11:49:53 +01:00
Thomas Martitz
bc9a45b05f icons: Remove automatic left padding if x == 0.
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
2014-01-07 11:36:00 +01:00
Bertrik Sikken
d023bf0f5d Fix checks on buflib allocated handles (0 is not a valid handle value)
Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
2012-06-10 17:15:47 +02:00
Michael Sevakis
da6cebb6b0 Use buflib for the allocation of voice PCM resources.
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
2012-05-02 17:22:28 -04: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
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
Thomas Martitz
9a70c42241 Add the ability to create a prefilled struct bitmap along with generated images.
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
2011-11-13 15:37:16 +00:00
Fred Bauer
7c6acd4783 close file descriptor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30962 a1c6a512-1295-4272-9138-f99709370657
2011-11-11 01:19:09 +00:00
Thomas Martitz
b02c82e105 Adapt icon and skin engine to make use of the new 32bit bitmap capabilities.
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
2011-11-08 21:39:28 +00:00
Thomas Martitz
13209604c1 Add new lcd_bmp and lcd_bmp_part APIs.
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
2011-11-08 21:34:46 +00:00
Thomas Martitz
1afcd74fdd Simplify icon.c a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30934 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 21:23:02 +00:00
Jonathan Gordon
452a3ce274 Put icons on buflib:
Removes the max icon size limitation and doesnt waste RAM

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30931 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 09:36:35 +00:00
Thomas Martitz
3b12634e6b Commit FS#12321 - Touchscreen: List line padding, to more easily select lines
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
2011-10-17 17:38:10 +00:00
Thomas Martitz
2c2416094f Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-12-06 22:26:31 +00:00
Thomas Martitz
41910a04b7 Adapt icon loading to get_user_file_path()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28484 a1c6a512-1295-4272-9138-f99709370657
2010-11-04 23:15:52 +00:00
Teruaki Kawashima
0952848368 reduce ramusage slightly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28355 a1c6a512-1295-4272-9138-f99709370657
2010-10-25 12:18:21 +00:00
Teruaki Kawashima
8bcb4927f3 fix loding of default remote viewers icons.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28288 a1c6a512-1295-4272-9138-f99709370657
2010-10-16 12:50:44 +00:00
Teruaki Kawashima
44780475bc Fix FS#10981: Viewers icons applied incorrectly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28286 a1c6a512-1295-4272-9138-f99709370657
2010-10-16 11:05:09 +00:00
Tomer Shalev
6a12b82a85 Fine tuning of gui elements positioning in RTL mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22976 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 23:41:59 +00:00
Tomer Shalev
fa69df3324 - Use const when possible
- Use pointer to avoid repeated access to array
- Move setting xpos up a bit


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22975 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 23:13:01 +00:00
Tomer Shalev
6d80565b1b RTL support in menus
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22945 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 11:43:38 +00:00
Karl Kurbjun
25123570c7 Fix STRIDE macro for multiscreen and add stride support for picture lib.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22615 a1c6a512-1295-4272-9138-f99709370657
2009-09-04 00:46:24 +00:00
Karl Kurbjun
7bb7c5f0cc Add stride defines to support vertical strides
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22546 a1c6a512-1295-4272-9138-f99709370657
2009-08-29 19:31:29 +00:00
Karl Kurbjun
f451108fa8 M:Robe 500: Increase the max icon size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22393 a1c6a512-1295-4272-9138-f99709370657
2009-08-18 00:53:27 +00:00
Andrew Mahone
9058620849 Make scaler output truly pluggable, add an 8-bit greyscale output to
pluginlib for use with greylib, and add source for a test scaled bmp
viewer using greylib.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19593 a1c6a512-1295-4272-9138-f99709370657
2008-12-26 07:05:13 +00:00
Björn Stenberg
ac488f8cb7 Makefile overhaul. All generated bitmaps are now explicitly in OBJDIR/bitmaps and OBJDIR/pluginbitmaps, and plugins properly depend on their respective bitmap files. Fixes #6847.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18987 a1c6a512-1295-4272-9138-f99709370657
2008-11-03 14:37:50 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Jonathan Gordon
bdbdb97f19 FS#9051 - remove LCD margins... use viewports if you need them...
NOTE to WPS people....
%m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored.
Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected.

Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
2008-06-23 13:20:35 +00:00
Jonathan Gordon
9d3694ced6 Fix FS#7056 - dont display garbage if the viewer icon set and the main iconset have different icon heights
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13237 a1c6a512-1295-4272-9138-f99709370657
2007-04-22 08:50:24 +00:00
Magnus Holmgren
392a4ef49b Fix logf builds on devices that support remotes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13202 a1c6a512-1295-4272-9138-f99709370657
2007-04-18 17:49:32 +00:00
Jonathan Gordon
e9610dca80 Remove unneeded #include, comment the filename define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13193 a1c6a512-1295-4272-9138-f99709370657
2007-04-17 08:37:01 +00:00
Jonathan Gordon
754d9195f7 explicitly set *loaded_ok = false; when given "" for a filename.
remove icon_init from the startup sequence, its not dependant on filetypes_init anymore,settings_apply calls the icons_init (causes the bmp's to only be read once on boot instead of twice)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13191 a1c6a512-1295-4272-9138-f99709370657
2007-04-17 06:37:22 +00:00
Jens Arnold
79a8b41513 Fix loadable remote icons. fb_data != fb_remote_data ...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13190 a1c6a512-1295-4272-9138-f99709370657
2007-04-17 01:03:25 +00:00
Jens Arnold
f87eaf3c4e Fix non-working default viewer icons. Remote viewer icons work now, but still not properly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13189 a1c6a512-1295-4272-9138-f99709370657
2007-04-17 00:29:04 +00:00
Jens Arnold
ded87cfcf5 Fix yellow...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13188 a1c6a512-1295-4272-9138-f99709370657
2007-04-17 00:08:58 +00:00
Jens Arnold
539c513fe6 Temporary fix for remote bitmap functions in the multi-screen API. Fixed icon.c to use this. Also fixed crash due to missing assignment of lcd_bitmap[_part] for monochrome main LCDs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13187 a1c6a512-1295-4272-9138-f99709370657
2007-04-16 23:55:19 +00:00
Magnus Holmgren
62994d42a7 Reduce code size a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13185 a1c6a512-1295-4272-9138-f99709370657
2007-04-16 19:17:37 +00:00
Jonathan Gordon
a9c1df4001 * its name[rows][columns] you drongo!
* make custom viewer icons work slightly better
* minor nit-picks to keep crop happy
* create a /.rockbox/themes/default_rockbox_icons.cfg to restore the default icons easily


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13183 a1c6a512-1295-4272-9138-f99709370657
2007-04-16 14:33:29 +00:00
Jonathan Gordon
b6658bbeef Santiy check shouldnt have been commented out
Show the ? icon on the remote if the requested icon (from a .icons file) isnt in the remote viewer iconset


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13182 a1c6a512-1295-4272-9138-f99709370657
2007-04-16 12:50:01 +00:00
Jonathan Gordon
4a16739bdd Some gremlins got into my computer again and changed all my code!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13181 a1c6a512-1295-4272-9138-f99709370657
2007-04-16 12:26:49 +00:00