From fdba8404503af0448586615330a7b27f2ced531c Mon Sep 17 00:00:00 2001 From: Yoshihisa Uchida Date: Sat, 5 Jun 2010 10:30:08 +0000 Subject: reworks text viewer plugin. (FS#11209) new text viewer plugin: text_viewer.rock. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26571 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/CATEGORIES | 1 + apps/plugins/SUBDIRS | 1 + apps/plugins/text_viewer/SOURCES | 12 + apps/plugins/text_viewer/readme.txt | 62 +++ apps/plugins/text_viewer/text_viewer.c | 210 ++++++++++ apps/plugins/text_viewer/text_viewer.make | 20 + apps/plugins/text_viewer/tv_action.c | 186 +++++++++ apps/plugins/text_viewer/tv_action.h | 119 ++++++ apps/plugins/text_viewer/tv_bookmark.c | 302 ++++++++++++++ apps/plugins/text_viewer/tv_bookmark.h | 85 ++++ apps/plugins/text_viewer/tv_button.h | 424 ++++++++++++++++++++ apps/plugins/text_viewer/tv_menu.c | 349 ++++++++++++++++ apps/plugins/text_viewer/tv_menu.h | 43 ++ apps/plugins/text_viewer/tv_pager.c | 337 ++++++++++++++++ apps/plugins/text_viewer/tv_pager.h | 104 +++++ apps/plugins/text_viewer/tv_preferences.c | 119 ++++++ apps/plugins/text_viewer/tv_preferences.h | 129 ++++++ apps/plugins/text_viewer/tv_reader.c | 191 +++++++++ apps/plugins/text_viewer/tv_reader.h | 102 +++++ apps/plugins/text_viewer/tv_screen_pos.c | 41 ++ apps/plugins/text_viewer/tv_screen_pos.h | 56 +++ apps/plugins/text_viewer/tv_settings.c | 519 ++++++++++++++++++++++++ apps/plugins/text_viewer/tv_settings.h | 73 ++++ apps/plugins/text_viewer/tv_text_processor.c | 576 +++++++++++++++++++++++++++ apps/plugins/text_viewer/tv_text_processor.h | 80 ++++ apps/plugins/text_viewer/tv_text_reader.c | 91 +++++ apps/plugins/text_viewer/tv_text_reader.h | 101 +++++ apps/plugins/text_viewer/tv_window.c | 394 ++++++++++++++++++ apps/plugins/text_viewer/tv_window.h | 69 ++++ apps/plugins/viewers.config | 4 +- 30 files changed, 4798 insertions(+), 2 deletions(-) create mode 100644 apps/plugins/text_viewer/SOURCES create mode 100644 apps/plugins/text_viewer/readme.txt create mode 100644 apps/plugins/text_viewer/text_viewer.c create mode 100644 apps/plugins/text_viewer/text_viewer.make create mode 100644 apps/plugins/text_viewer/tv_action.c create mode 100644 apps/plugins/text_viewer/tv_action.h create mode 100644 apps/plugins/text_viewer/tv_bookmark.c create mode 100644 apps/plugins/text_viewer/tv_bookmark.h create mode 100644 apps/plugins/text_viewer/tv_button.h create mode 100644 apps/plugins/text_viewer/tv_menu.c create mode 100644 apps/plugins/text_viewer/tv_menu.h create mode 100644 apps/plugins/text_viewer/tv_pager.c create mode 100644 apps/plugins/text_viewer/tv_pager.h create mode 100644 apps/plugins/text_viewer/tv_preferences.c create mode 100644 apps/plugins/text_viewer/tv_preferences.h create mode 100644 apps/plugins/text_viewer/tv_reader.c create mode 100644 apps/plugins/text_viewer/tv_reader.h create mode 100644 apps/plugins/text_viewer/tv_screen_pos.c create mode 100644 apps/plugins/text_viewer/tv_screen_pos.h create mode 100644 apps/plugins/text_viewer/tv_settings.c create mode 100644 apps/plugins/text_viewer/tv_settings.h create mode 100644 apps/plugins/text_viewer/tv_text_processor.c create mode 100644 apps/plugins/text_viewer/tv_text_processor.h create mode 100644 apps/plugins/text_viewer/tv_text_reader.c create mode 100644 apps/plugins/text_viewer/tv_text_reader.h create mode 100644 apps/plugins/text_viewer/tv_window.c create mode 100644 apps/plugins/text_viewer/tv_window.h diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index f797c4038d..437988bd22 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES @@ -111,6 +111,7 @@ test_touchscreen,apps test_viewports,apps test_greylib_bitmap_scale,viewers text_editor,apps +text_viewer,viewers theme_remove,viewers vbrfix,viewers video,viewers diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index a6b5cda363..cf1e9d2b80 100644 --- a/apps/plugins/SUBDIRS +++ b/apps/plugins/SUBDIRS @@ -1,5 +1,6 @@ /* For all targets */ shortcuts +text_viewer /* For various targets... */ diff --git a/apps/plugins/text_viewer/SOURCES b/apps/plugins/text_viewer/SOURCES new file mode 100644 index 0000000000..7e45d1fb68 --- /dev/null +++ b/apps/plugins/text_viewer/SOURCES @@ -0,0 +1,12 @@ +text_viewer.c +tv_action.c +tv_bookmark.c +tv_menu.c +tv_pager.c +tv_preferences.c +tv_reader.c +tv_screen_pos.c +tv_settings.c +tv_text_processor.c +tv_text_reader.c +tv_window.c diff --git a/apps/plugins/text_viewer/readme.txt b/apps/plugins/text_viewer/readme.txt new file mode 100644 index 0000000000..f124370bdc --- /dev/null +++ b/apps/plugins/text_viewer/readme.txt @@ -0,0 +1,62 @@ +about the text viewer plugin. + +Limitation + for the target which PLUGIN_BUFFER_SIZE < 0x13000 (i.e., archos series), + can only be read up to 999 pages. + + +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). + + [wod 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 two spaces. + - supports the player which does not define HAVE_LCD_BITMAP. + + [alignment] + - the right alignment supports the player which does not define HAVE_LCD_BITMAP. + + [bookmark] + - increased to 16 the number of bookmarks that can be registered. + + +TODO list + - for the target which PLUGIN_BUFFER_SIZE < 0x13000 (i.e., archos series), + supports more than 999 pages of text. + + - add History feature. + + - when the WIDE screen, allow to specify the number of screens. + + - when the line_mode is reflow, allow to specify indent spaces. + + - for the horizontal scroll, allow the select scroll by screen/scroll by column for the settings menu. + + - can display the horizontal scroll bar. + + - draw images that are linked to the text. () + + - play audios that are linked to the text. (