Commit graph

21 commits

Author SHA1 Message Date
Solomon Peachy
a2c10f6189 unicode: Support characters beyond the first unicode plane
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.

This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match.  This includes:

 * utf8decode() and friends
 * font manipulation, caching, rendering, and generation
 * on-screen keyboard
 * FAT filesystem (parsing and generating utf16 LFNs)
 * WIN32 simulator platform code

Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.

Appears to work on:

  * hosted linux, native, linux simulator in both 16/32-bit modes.

Needs testing on:

  * windows and macos simulator (16bit+32bit)

Change-Id: Iba111b27d2433019b6bff937cf1ebd2c4353a0e8
2025-09-12 09:24:30 -04:00
Solomon Peachy
84504c7471 Revert "internals: Support characters beyond the first unicode plane (WIP)"
This reverts commit d05c59f35b.
2025-08-20 16:09:49 -04:00
Solomon Peachy
d05c59f35b internals: Support characters beyond the first unicode plane (WIP)
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.

This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match.  This includes:

 * utf8decode() and friends
 * on-screen keyboard
 * font manipulation, caching, rendering, and generation
 * VFAT code parses and generates utf16 dirents
 * WIN32 simulator reads and writes utf16 filenames

Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.

Known bugs:

  * Native players in 32-bit unicode mode generate mangled filename
    entries if they include UTF16 surrogate codepoints.  Root cause
    is unclear, and may reside in core dircache code.

Needs testing on:

 * windows simulator (16bit+32bit)

Change-Id: I193a00fe2a11a4181ddc82df2d71be52bf00b6e6
2025-08-20 16:08:43 -04:00
Christian Soffke
348054712d fix red f3d127f372
Change-Id: I62e7f16c49d8e6f7f8645e1f27ee4fa0cfecee66
2025-05-27 05:46:19 +02:00
Christian Soffke
f3d127f372 Minor confirm prompt adjustments
* Rename LANG_RESET_ASK to LANG_ARE_YOU_SURE,
  so that it matches the actual language string
  (translations remain valid), and can be repurposed
  for generic confirmation prompts, where the
  first line says "Are you sure?", and the second
  line reiterates the selected action

* Add "Reset Settings" as second line to the prompt
  shown before resetting settings, instead of just
  asking "Are you sure?"

* Make Shuffle prompt consistent between WPS and
  Playlist Viewer, and ask whether user is sure they
  want to Shuffle instead of warning them that the
  current playlist will be erased, which was a bit
  misleading

* Explicitly say "Cancelled" when user answers NO to
  erasing the current playlist or to overwriting a file.
  Improves consistency with other prompts that are
  displayed for potentially destructive actions, e.g.
  before items are deleted, renamed, saved, or reset.

* PictureFlow: Prompt before rebuilding/updating cache

Change-Id: Id8ae36db7187315eb1a374701307e6ab4dcdbd1d
2025-05-26 23:15:53 -04:00
William Wilgus
f017ef9617 [FixRed] android yesno dialog
add a dummy fn with not for future dev

Change-Id: I2afc06bb1eaeb19b4972b625b6245c2361d8b8e7
2023-10-01 12:21:54 -04:00
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
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-14 23:56:16 -05:00
Aidan MacDonald
55185277ba Fix red for Android builds (c6ee9dc883)
Change-Id: I416fbd24bd2dd91738cb8664b8f3f4877905336d
2022-10-17 15:20:28 +01:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
Thomas Martitz
361aa9263d Fix reds.
Change-Id: I4f065a5b9f96df4d70ee8bb2836effc9b97b01fa
2014-03-14 23:43:45 +01:00
Thomas Martitz
470989bd70 events: Rework event subsystem (add_event, send_event) to be more versatile.
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
2014-03-14 23:36:30 +01:00
Michael Sevakis
023f6b6efd Get rid of some superfluous single-purpose functions in playback.
* 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
2013-07-13 00:08:51 -04:00
Thomas Martitz
4e8893b874 android: Fix crash on start up.
Change-Id: I0343de9347d100182c2ffd28058ac61f15097cc3
2012-03-30 11:23:07 +02:00
Alexander Levin
63c4ef9f57 Rename 'mp3entry.embed_albumart' to 'mp3entry.has_embedded_albumart' (FS#12470). No functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31405 a1c6a512-1295-4272-9138-f99709370657
2011-12-22 18:48:43 +00:00
Björn Stenberg
0942e2a0f7 Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:35:02 +00:00
Jonathan Gordon
22332e8c0a Copy yesno_pop to hosted/yesno,c which is mildly annoying, maybe do a better fix later
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30185 a1c6a512-1295-4272-9138-f99709370657
2011-07-21 06:51:55 +00:00
Thomas Martitz
046cec3aa7 Android: Partly revert r29569 and only call the new getJavaEnvironment() when needed.
The environment is fine to share in general, just not across OS threads, so it's only needed
for functions which are possibly called from multiple OS threads (only 1 currently).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29601 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 14:33:55 +00:00
Maurus Cuelenaere
c2ee32b22a Partly revert "Android: use NewGlobalRef for references that are used globally"
The added complexity wasn't needed for most subsystems, as main() never returns
so local references can't be freed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29570 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 19:23:00 +00:00
Maurus Cuelenaere
66f2a08f8a Android: Don't share the JNI environment across threads, but obtain it the
correct way

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29569 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 18:34:35 +00:00
Maurus Cuelenaere
2e5b7aebde Android: use NewGlobalRef for references that are used globally
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29568 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 18:34:31 +00:00
Maurus Cuelenaere
d833e78fac RaaA: move Android apps-code to separate dir under apps/hosted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29563 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:44 +00:00