forked from len0rd/rockbox
text viewer: can display the horizontal scroll bar.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26620 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
19ac3453e0
commit
240b198d65
6 changed files with 106 additions and 57 deletions
|
|
@ -39,14 +39,15 @@
|
|||
* windows 1 (when version <= 0x32, this value is view_mode)
|
||||
* alignment 1
|
||||
* encoding 1
|
||||
* scrollbar_mode 1
|
||||
* vertical_scrollbar 1
|
||||
* (unused) 1 (for compatibility)
|
||||
* page_mode 1
|
||||
* page_number_mode 1
|
||||
* title_mode 1
|
||||
* scroll_mode 1
|
||||
* autoscroll_speed 1
|
||||
* (reserved) 16
|
||||
* horizontal_scrollbar 1
|
||||
* (reserved) 15
|
||||
* font name MAX_PATH
|
||||
*/
|
||||
|
||||
|
|
@ -54,7 +55,7 @@
|
|||
#define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat"
|
||||
|
||||
#define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */
|
||||
#define TV_GLOBAL_SETTINGS_VERSION 0x33
|
||||
#define TV_GLOBAL_SETTINGS_VERSION 0x34
|
||||
#define TV_GLOBAL_SETTINGS_HEADER_SIZE 5
|
||||
#define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31
|
||||
|
||||
|
|
@ -77,14 +78,15 @@
|
|||
* windows 1 (when version <= 0x33, this value is view_mode)
|
||||
* alignment 1
|
||||
* encoding 1
|
||||
* scrollbar_mode 1
|
||||
* vertical_scrollbar 1
|
||||
* (unused) 1 (for compatibility)
|
||||
* page_mode 1
|
||||
* header_mode 1
|
||||
* footer_mode 1
|
||||
* scroll_mode 1
|
||||
* autoscroll_speed 1
|
||||
* (reserved) 16
|
||||
* horizontal_scrollbar 1
|
||||
* (reserved) 15
|
||||
* font name MAX_PATH
|
||||
* bookmark count 1
|
||||
* [1st bookmark]
|
||||
|
|
@ -106,7 +108,7 @@
|
|||
#define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp"
|
||||
|
||||
#define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */
|
||||
#define TV_SETTINGS_VERSION 0x34
|
||||
#define TV_SETTINGS_VERSION 0x35
|
||||
#define TV_SETTINGS_HEADER_SIZE 4
|
||||
#define TV_SETTINGS_FIRST_VERSION 0x32
|
||||
|
||||
|
|
@ -143,8 +145,8 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre
|
|||
else
|
||||
prefs->alignment = LEFT;
|
||||
|
||||
prefs->encoding = *p++;
|
||||
prefs->scrollbar_mode = *p++;
|
||||
prefs->encoding = *p++;
|
||||
prefs->vertical_scrollbar = *p++;
|
||||
/* skip need_scrollbar */
|
||||
p++;
|
||||
prefs->page_mode = *p++;
|
||||
|
|
@ -153,6 +155,11 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre
|
|||
prefs->scroll_mode = *p++;
|
||||
prefs->autoscroll_speed = *p++;
|
||||
|
||||
if (version > 2)
|
||||
prefs->horizontal_scrollbar = *p;
|
||||
else
|
||||
prefs->horizontal_scrollbar = SB_OFF;
|
||||
|
||||
rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH);
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
@ -172,7 +179,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs)
|
|||
*p++ = prefs->windows;
|
||||
*p++ = prefs->alignment;
|
||||
*p++ = prefs->encoding;
|
||||
*p++ = prefs->scrollbar_mode;
|
||||
*p++ = prefs->vertical_scrollbar;
|
||||
/* skip need_scrollbar */
|
||||
p++;
|
||||
*p++ = prefs->page_mode;
|
||||
|
|
@ -180,6 +187,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs)
|
|||
*p++ = prefs->footer_mode;
|
||||
*p++ = prefs->scroll_mode;
|
||||
*p++ = prefs->autoscroll_speed;
|
||||
*p++ = prefs->horizontal_scrollbar;
|
||||
|
||||
rb->memcpy(buf + 28, prefs->font_name, MAX_PATH);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue