rockbox/apps/plugins/text_viewer
Christian Soffke 18dfd8f691 Reduce list title glitches when switching between menus
Each time viewportmanager_theme_enable (or _undo) is called,
the SBS title is reset, even if the theme remains enabled.
Thus switching from one menu to another, if do_menu is called
again, briefly results in an empty title before the correct
one is displayed. Even unchanged titles will unnecessarily
flash for a moment. Other theme elements that are drawn using
conditions based on the title, may also appear glitchy.

This patch adds a way to make the status bar title persist by
copying it to a static buffer. Persistent titles are not reset
by toggle_theme (although scrolling will be stopped in
viewportmanager_theme_undo), so that the theme can immediately
display the appropriate title in do_menu, simplelist_show_list,
the yesno screen, or plugins that want to keep the theme enabled.

Change-Id: I1ec8f233b730321793eb7d3cad51496ee1b35440
2026-01-13 20:06:33 -05:00
..
readme.txt Remove some SWCODEC artifacts 2020-11-14 19:20:33 -05:00
SOURCES
text_viewer.c FS#13434: Partially internationalize the textviewer plugin 2024-06-11 09:53:40 -04:00
text_viewer.make
tv_action.c plugins: text viewer: use SBS title 2025-12-27 16:29:16 +01:00
tv_action.h
tv_bookmark.c FS#13434: Partially internationalize the textviewer plugin 2024-06-11 09:53:40 -04:00
tv_bookmark.h Commit FS#11799 by Alexander Meshcheryakov. Improves the text viewer plugin to write to the disk less often, and correct several minor bugs. 2010-12-14 21:33:45 +00:00
tv_button.h 3ds: Enable plugins for the 3ds platform. 2025-12-31 21:13:34 -05:00
tv_display.c Reduce list title glitches when switching between menus 2026-01-13 20:06:33 -05:00
tv_display.h plugins: text viewer: use SBS title 2025-12-27 16:29:16 +01:00
tv_menu.c plugins & debug menu: apply consistent titles 2025-12-23 10:25:05 -05:00
tv_menu.h
tv_pager.c fix warnings on some systems / format specifier mismatch 2024-12-07 11:07:44 -05:00
tv_pager.h
tv_preferences.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
tv_preferences.h [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
tv_reader.c
tv_reader.h
tv_screen_pos.c
tv_screen_pos.h
tv_settings.c Fix typos and wording 2020-11-04 12:57:15 +00:00
tv_settings.h Commit FS#11799 by Alexander Meshcheryakov. Improves the text viewer plugin to write to the disk less often, and correct several minor bugs. 2010-12-14 21:33:45 +00:00
tv_text_processor.c unicode: Support characters beyond the first unicode plane 2025-09-12 09:24:30 -04:00
tv_text_processor.h
tv_text_reader.c
tv_text_reader.h
tv_window.c plugins: text viewer: use SBS title 2025-12-27 16:29:16 +01:00
tv_window.h plugins: text viewer: use SBS title 2025-12-27 16:29:16 +01:00

About the text viewer plugin.

Limitation
    for targets where PLUGIN_BUFFER_SIZE < 0x13000,
    Only 999 pages can be read.
    


Difference between viewer.rock
    [settings file]
       - the global setting, 'tv_global.dat' is stored.
       - Settings and bookmarks for each file, 'tv_file.dat' is stored.

      Note: when viewer.dat(viewer_file.dat) exists, tv_global.dat(tv_file.dat) is created by
            using viewer.dat(viewer_file.dat).

    [word wrap]
          - add the following characters which can be split the line.
                '!', ',', '.', ':', ';', '?', 
                U+00b7, U+2010, U+3000, U+3001, U+3002, U+30fb, U+30fc, 
                U+ff01, U+ff0c, U+ff0d, U+ff0e, U+ff1a, U+ff1b, U+ff1f.

          - when the line split, if the line length is short ( < 0.75 * display width), 
            split the line in display width. (thus, maybe split a word)

    [line mode]
       [join]
           - break line condition has changed.
               - If the next line is a blank line or spaces only line, this line breaks.

       [reflow]
           - indent changes is two spaces (changable in the settings).

    [bookmark]
           - increased the number of bookmarks that can be registered to 16.


TODO list
  - for the target which PLUGIN_BUFFER_SIZE < 0x13000,   
    support more than 999 pages of text.

  - add History feature.

  - draw images that are linked to the text. (<img src="...">)

  - play audios that are linked to the text. (<audio src="...">)

  - more treatments of line breaking, word wrappings.
    (for example, period does not appear the top of line.)