diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-07 11:04:09 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-07 11:04:09 +0000 |
commit | 1ce70a679c645c1886eff1d96c5c9f2a630066d6 (patch) | |
tree | c8923657ef6108481f789314202ba35c4563c0fb | |
parent | 04fd0ce374ff3b7c21ec9619a9b35f796b4d9168 (diff) | |
download | rockbox-1ce70a679c645c1886eff1d96c5c9f2a630066d6.tar.gz rockbox-1ce70a679c645c1886eff1d96c5c9f2a630066d6.zip |
text viewer: can selected scroll by column/scroll by screen for the horizontal screen.
Viewer Options: "Scrollbar", "Overlap Pages", "Auto-Scroll Speed" move to Scroll Settings > Vertical.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26654 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/text_viewer/readme.txt | 2 | ||||
-rw-r--r-- | apps/plugins/text_viewer/text_viewer.c | 4 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_action.c | 14 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_action.h | 2 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_bookmark.c | 2 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_menu.c | 133 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_preferences.c | 6 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_preferences.h | 9 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_settings.c | 28 |
9 files changed, 131 insertions, 69 deletions
diff --git a/apps/plugins/text_viewer/readme.txt b/apps/plugins/text_viewer/readme.txt index 0e9bd7ce49..1180965fe4 100644 --- a/apps/plugins/text_viewer/readme.txt +++ b/apps/plugins/text_viewer/readme.txt | |||
@@ -46,8 +46,6 @@ TODO list | |||
46 | 46 | ||
47 | - when the line_mode is reflow, allow to specify indent spaces. | 47 | - when the line_mode is reflow, allow to specify indent spaces. |
48 | 48 | ||
49 | - for the horizontal scroll, allow the select scroll by screen/scroll by column for the settings menu. | ||
50 | |||
51 | - draw images that are linked to the text. (<img src="...">) | 49 | - draw images that are linked to the text. (<img src="...">) |
52 | 50 | ||
53 | - play audios that are linked to the text. (<audio src="...">) | 51 | - play audios that are linked to the text. (<audio src="...">) |
diff --git a/apps/plugins/text_viewer/text_viewer.c b/apps/plugins/text_viewer/text_viewer.c index 452f7108a6..ea8972491b 100644 --- a/apps/plugins/text_viewer/text_viewer.c +++ b/apps/plugins/text_viewer/text_viewer.c | |||
@@ -111,7 +111,7 @@ enum plugin_status plugin_start(const void* file) | |||
111 | if (prefs->windows > 1) | 111 | if (prefs->windows > 1) |
112 | { | 112 | { |
113 | /* Screen left */ | 113 | /* Screen left */ |
114 | tv_scroll_left(TV_HORIZONTAL_SCROLL_WINDOW); | 114 | tv_scroll_left(TV_HORIZONTAL_SCROLL_PREFS); |
115 | } | 115 | } |
116 | else { /* prefs->windows == 1 */ | 116 | else { /* prefs->windows == 1 */ |
117 | /* scroll to previous page */ | 117 | /* scroll to previous page */ |
@@ -128,7 +128,7 @@ enum plugin_status plugin_start(const void* file) | |||
128 | if (prefs->windows > 1) | 128 | if (prefs->windows > 1) |
129 | { | 129 | { |
130 | /* Screen right */ | 130 | /* Screen right */ |
131 | tv_scroll_right(TV_HORIZONTAL_SCROLL_WINDOW); | 131 | tv_scroll_right(TV_HORIZONTAL_SCROLL_PREFS); |
132 | } | 132 | } |
133 | else { /* prefs->windows == 1 */ | 133 | else { /* prefs->windows == 1 */ |
134 | /* scroll to next page */ | 134 | /* scroll to next page */ |
diff --git a/apps/plugins/text_viewer/tv_action.c b/apps/plugins/text_viewer/tv_action.c index fb7fdb40e6..1f2ad78666 100644 --- a/apps/plugins/text_viewer/tv_action.c +++ b/apps/plugins/text_viewer/tv_action.c | |||
@@ -89,7 +89,7 @@ void tv_scroll_up(enum tv_vertical_scroll_mode mode) | |||
89 | int offset_line = -1; | 89 | int offset_line = -1; |
90 | 90 | ||
91 | if ((mode == TV_VERTICAL_SCROLL_PAGE) || | 91 | if ((mode == TV_VERTICAL_SCROLL_PAGE) || |
92 | (mode == TV_VERTICAL_SCROLL_PREFS && prefs->scroll_mode == PAGE)) | 92 | (mode == TV_VERTICAL_SCROLL_PREFS && prefs->vertical_scroll_mode == PAGE)) |
93 | { | 93 | { |
94 | offset_page--; | 94 | offset_page--; |
95 | #ifdef HAVE_LCD_BITMAP | 95 | #ifdef HAVE_LCD_BITMAP |
@@ -105,7 +105,7 @@ void tv_scroll_down(enum tv_vertical_scroll_mode mode) | |||
105 | int offset_line = 1; | 105 | int offset_line = 1; |
106 | 106 | ||
107 | if ((mode == TV_VERTICAL_SCROLL_PAGE) || | 107 | if ((mode == TV_VERTICAL_SCROLL_PAGE) || |
108 | (mode == TV_VERTICAL_SCROLL_PREFS && prefs->scroll_mode == PAGE)) | 108 | (mode == TV_VERTICAL_SCROLL_PREFS && prefs->vertical_scroll_mode == PAGE)) |
109 | { | 109 | { |
110 | offset_page++; | 110 | offset_page++; |
111 | #ifdef HAVE_LCD_BITMAP | 111 | #ifdef HAVE_LCD_BITMAP |
@@ -120,7 +120,8 @@ void tv_scroll_left(enum tv_horizontal_scroll_mode mode) | |||
120 | int offset_window = 0; | 120 | int offset_window = 0; |
121 | int offset_column = 0; | 121 | int offset_column = 0; |
122 | 122 | ||
123 | if (mode == TV_HORIZONTAL_SCROLL_COLUMN) | 123 | if ((mode == TV_HORIZONTAL_SCROLL_COLUMN) || |
124 | (mode == TV_HORIZONTAL_SCROLL_PREFS && prefs->horizontal_scroll_mode == COLUMN)) | ||
124 | { | 125 | { |
125 | /* Scroll left one column */ | 126 | /* Scroll left one column */ |
126 | offset_column--; | 127 | offset_column--; |
@@ -138,7 +139,8 @@ void tv_scroll_right(enum tv_horizontal_scroll_mode mode) | |||
138 | int offset_window = 0; | 139 | int offset_window = 0; |
139 | int offset_column = 0; | 140 | int offset_column = 0; |
140 | 141 | ||
141 | if (mode == TV_HORIZONTAL_SCROLL_COLUMN) | 142 | if ((mode == TV_HORIZONTAL_SCROLL_COLUMN) || |
143 | (mode == TV_HORIZONTAL_SCROLL_PREFS && prefs->horizontal_scroll_mode == COLUMN)) | ||
142 | { | 144 | { |
143 | /* Scroll right one column */ | 145 | /* Scroll right one column */ |
144 | offset_column++; | 146 | offset_column++; |
@@ -159,7 +161,7 @@ void tv_top(void) | |||
159 | void tv_bottom(void) | 161 | void tv_bottom(void) |
160 | { | 162 | { |
161 | tv_move_screen(0, 0, SEEK_END); | 163 | tv_move_screen(0, 0, SEEK_END); |
162 | if (prefs->scroll_mode == PAGE) | 164 | if (prefs->vertical_scroll_mode == PAGE) |
163 | tv_move_screen(0, -tv_get_screen_pos()->line, SEEK_CUR); | 165 | tv_move_screen(0, -tv_get_screen_pos()->line, SEEK_CUR); |
164 | } | 166 | } |
165 | 167 | ||
@@ -172,7 +174,7 @@ enum tv_menu_result tv_menu(void) | |||
172 | res = tv_display_menu(); | 174 | res = tv_display_menu(); |
173 | 175 | ||
174 | tv_convert_fpos(cur_file_pos, &cur_pos); | 176 | tv_convert_fpos(cur_file_pos, &cur_pos); |
175 | if (prefs->scroll_mode == PAGE) | 177 | if (prefs->vertical_scroll_mode == PAGE) |
176 | cur_pos.line = 0; | 178 | cur_pos.line = 0; |
177 | 179 | ||
178 | tv_move_screen(cur_pos.page, cur_pos.line, SEEK_SET); | 180 | tv_move_screen(cur_pos.page, cur_pos.line, SEEK_SET); |
diff --git a/apps/plugins/text_viewer/tv_action.h b/apps/plugins/text_viewer/tv_action.h index c5f7bd0e2f..b01079cbd1 100644 --- a/apps/plugins/text_viewer/tv_action.h +++ b/apps/plugins/text_viewer/tv_action.h | |||
@@ -29,7 +29,7 @@ | |||
29 | enum tv_horizontal_scroll_mode | 29 | enum tv_horizontal_scroll_mode |
30 | { | 30 | { |
31 | TV_HORIZONTAL_SCROLL_COLUMN, /* left/right one column */ | 31 | TV_HORIZONTAL_SCROLL_COLUMN, /* left/right one column */ |
32 | TV_HORIZONTAL_SCROLL_WINDOW, /* left/right one window */ | 32 | TV_HORIZONTAL_SCROLL_SCREEN, /* left/right one screen */ |
33 | TV_HORIZONTAL_SCROLL_PREFS, /* left/right follows the settings */ | 33 | TV_HORIZONTAL_SCROLL_PREFS, /* left/right follows the settings */ |
34 | }; | 34 | }; |
35 | 35 | ||
diff --git a/apps/plugins/text_viewer/tv_bookmark.c b/apps/plugins/text_viewer/tv_bookmark.c index 61df02705e..78e4c60a83 100644 --- a/apps/plugins/text_viewer/tv_bookmark.c +++ b/apps/plugins/text_viewer/tv_bookmark.c | |||
@@ -224,7 +224,7 @@ void tv_select_bookmark(void) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | /* move to the select position */ | 226 | /* move to the select position */ |
227 | if (tv_get_preferences()->scroll_mode == PAGE) | 227 | if (tv_get_preferences()->vertical_scroll_mode == PAGE) |
228 | select_pos.line = 0; | 228 | select_pos.line = 0; |
229 | 229 | ||
230 | tv_move_screen(select_pos.page, select_pos.line, SEEK_SET); | 230 | tv_move_screen(select_pos.page, select_pos.line, SEEK_SET); |
diff --git a/apps/plugins/text_viewer/tv_menu.c b/apps/plugins/text_viewer/tv_menu.c index ff2d6758a4..38c4af1f96 100644 --- a/apps/plugins/text_viewer/tv_menu.c +++ b/apps/plugins/text_viewer/tv_menu.c | |||
@@ -30,7 +30,10 @@ | |||
30 | 30 | ||
31 | static struct tv_preferences new_prefs; | 31 | static struct tv_preferences new_prefs; |
32 | 32 | ||
33 | /* scrollbar menu */ | 33 | /* */ |
34 | /* horizontal scroll settings menu */ | ||
35 | /* */ | ||
36 | |||
34 | #ifdef HAVE_LCD_BITMAP | 37 | #ifdef HAVE_LCD_BITMAP |
35 | static bool tv_horizontal_scrollbar_setting(void) | 38 | static bool tv_horizontal_scrollbar_setting(void) |
36 | { | 39 | { |
@@ -42,7 +45,38 @@ static bool tv_horizontal_scrollbar_setting(void) | |||
42 | return rb->set_option("Horizontal Scrollbar", &new_prefs.horizontal_scrollbar, INT, | 45 | return rb->set_option("Horizontal Scrollbar", &new_prefs.horizontal_scrollbar, INT, |
43 | names, 2, NULL); | 46 | names, 2, NULL); |
44 | } | 47 | } |
48 | #endif | ||
49 | |||
50 | static bool tv_horizontal_scroll_mode_setting(void) | ||
51 | { | ||
52 | static const struct opt_items names[] = { | ||
53 | {"Scroll by Screen", -1}, | ||
54 | {"Scroll by Column", -1}, | ||
55 | }; | ||
56 | |||
57 | return rb->set_option("Scroll Mode", &new_prefs.horizontal_scroll_mode, INT, | ||
58 | names, 2, NULL); | ||
59 | } | ||
45 | 60 | ||
61 | #ifdef HAVE_LCD_BITMAP | ||
62 | MENUITEM_FUNCTION(horizontal_scrollbar_item, 0, "Scrollbar", | ||
63 | tv_horizontal_scrollbar_setting, | ||
64 | NULL, NULL, Icon_NOICON); | ||
65 | #endif | ||
66 | MENUITEM_FUNCTION(horizontal_scroll_mode_item, 0, "Scroll Mode", | ||
67 | tv_horizontal_scroll_mode_setting, NULL, NULL, Icon_NOICON); | ||
68 | |||
69 | MAKE_MENU(horizontal_scroll_menu, "Horizontal", NULL, Icon_NOICON, | ||
70 | #ifdef HAVE_LCD_BITMAP | ||
71 | &horizontal_scrollbar_item, | ||
72 | #endif | ||
73 | &horizontal_scroll_mode_item); | ||
74 | |||
75 | /* */ | ||
76 | /* vertical scroll settings menu */ | ||
77 | /* */ | ||
78 | |||
79 | #ifdef HAVE_LCD_BITMAP | ||
46 | static bool tv_vertical_scrollbar_setting(void) | 80 | static bool tv_vertical_scrollbar_setting(void) |
47 | { | 81 | { |
48 | static const struct opt_items names[] = { | 82 | static const struct opt_items names[] = { |
@@ -53,18 +87,64 @@ static bool tv_vertical_scrollbar_setting(void) | |||
53 | return rb->set_option("Vertical Scrollbar", &new_prefs.vertical_scrollbar, INT, | 87 | return rb->set_option("Vertical Scrollbar", &new_prefs.vertical_scrollbar, INT, |
54 | names, 2, NULL); | 88 | names, 2, NULL); |
55 | } | 89 | } |
90 | #endif | ||
56 | 91 | ||
57 | MENUITEM_FUNCTION(horizontal_scrollbar_item, 0, "Horizontal", | 92 | static bool tv_vertical_scroll_mode_setting(void) |
58 | tv_horizontal_scrollbar_setting, | 93 | { |
59 | NULL, NULL, Icon_NOICON); | 94 | static const struct opt_items names[] = { |
60 | MENUITEM_FUNCTION(vertical_scrollbar_item, 0, "Vertical", | 95 | {"Scroll by Page", -1}, |
96 | {"Scroll by Line", -1}, | ||
97 | }; | ||
98 | |||
99 | return rb->set_option("Scroll Mode", &new_prefs.vertical_scroll_mode, INT, | ||
100 | names, 2, NULL); | ||
101 | } | ||
102 | |||
103 | static bool tv_page_mode_setting(void) | ||
104 | { | ||
105 | static const struct opt_items names[] = { | ||
106 | {"No", -1}, | ||
107 | {"Yes", -1}, | ||
108 | }; | ||
109 | |||
110 | return rb->set_option("Overlap Pages", &new_prefs.page_mode, INT, | ||
111 | names, 2, NULL); | ||
112 | } | ||
113 | |||
114 | static bool tv_autoscroll_speed_setting(void) | ||
115 | { | ||
116 | return rb->set_int("Auto-scroll Speed", "", UNIT_INT, | ||
117 | &new_prefs.autoscroll_speed, NULL, 1, 1, 10, NULL); | ||
118 | } | ||
119 | |||
120 | #ifdef HAVE_LCD_BITMAP | ||
121 | MENUITEM_FUNCTION(vertical_scrollbar_item, 0, "Scrollbar", | ||
61 | tv_vertical_scrollbar_setting, | 122 | tv_vertical_scrollbar_setting, |
62 | NULL, NULL, Icon_NOICON); | 123 | NULL, NULL, Icon_NOICON); |
63 | MAKE_MENU(scrollbar_menu, "Scrollbar", NULL, Icon_NOICON, | ||
64 | &horizontal_scrollbar_item, &vertical_scrollbar_item); | ||
65 | #endif | 124 | #endif |
125 | MENUITEM_FUNCTION(vertical_scroll_mode_item, 0, "Scroll Mode", | ||
126 | tv_vertical_scroll_mode_setting, NULL, NULL, Icon_NOICON); | ||
127 | MENUITEM_FUNCTION(page_mode_item, 0, "Overlap Pages", tv_page_mode_setting, | ||
128 | NULL, NULL, Icon_NOICON); | ||
129 | MENUITEM_FUNCTION(autoscroll_speed_item, 0, "Auto-Scroll Speed", | ||
130 | tv_autoscroll_speed_setting, NULL, NULL, Icon_NOICON); | ||
131 | |||
132 | MAKE_MENU(vertical_scroll_menu, "Vertical", NULL, Icon_NOICON, | ||
133 | #ifdef HAVE_LCD_BITMAP | ||
134 | &vertical_scrollbar_item, | ||
135 | #endif | ||
136 | &vertical_scroll_mode_item, &page_mode_item, &autoscroll_speed_item); | ||
137 | |||
138 | /* */ | ||
139 | /* scroll settings menu */ | ||
140 | /* */ | ||
66 | 141 | ||
142 | MAKE_MENU(scroll_menu, "Scroll Settings", NULL, Icon_NOICON, | ||
143 | &horizontal_scroll_menu, &vertical_scroll_menu); | ||
144 | |||
145 | /* */ | ||
67 | /* main menu */ | 146 | /* main menu */ |
147 | /* */ | ||
68 | 148 | ||
69 | static bool tv_encoding_setting(void) | 149 | static bool tv_encoding_setting(void) |
70 | { | 150 | { |
@@ -111,17 +191,6 @@ static bool tv_windows_setting(void) | |||
111 | &new_prefs.windows, NULL, 1, 1, 5, NULL); | 191 | &new_prefs.windows, NULL, 1, 1, 5, NULL); |
112 | } | 192 | } |
113 | 193 | ||
114 | static bool tv_scroll_mode_setting(void) | ||
115 | { | ||
116 | static const struct opt_items names[] = { | ||
117 | {"Scroll by Page", -1}, | ||
118 | {"Scroll by Line", -1}, | ||
119 | }; | ||
120 | |||
121 | return rb->set_option("Scroll Mode", &new_prefs.scroll_mode, INT, | ||
122 | names, 2, NULL); | ||
123 | } | ||
124 | |||
125 | static bool tv_alignment_setting(void) | 194 | static bool tv_alignment_setting(void) |
126 | { | 195 | { |
127 | static const struct opt_items names[] = { | 196 | static const struct opt_items names[] = { |
@@ -134,17 +203,6 @@ static bool tv_alignment_setting(void) | |||
134 | } | 203 | } |
135 | 204 | ||
136 | #ifdef HAVE_LCD_BITMAP | 205 | #ifdef HAVE_LCD_BITMAP |
137 | static bool tv_page_mode_setting(void) | ||
138 | { | ||
139 | static const struct opt_items names[] = { | ||
140 | {"No", -1}, | ||
141 | {"Yes", -1}, | ||
142 | }; | ||
143 | |||
144 | return rb->set_option("Overlap Pages", &new_prefs.page_mode, INT, | ||
145 | names, 2, NULL); | ||
146 | } | ||
147 | |||
148 | static bool tv_header_setting(void) | 206 | static bool tv_header_setting(void) |
149 | { | 207 | { |
150 | int len = (rb->global_settings->statusbar == STATUSBAR_TOP)? 4 : 2; | 208 | int len = (rb->global_settings->statusbar == STATUSBAR_TOP)? 4 : 2; |
@@ -280,12 +338,6 @@ static bool tv_font_setting(void) | |||
280 | } | 338 | } |
281 | #endif | 339 | #endif |
282 | 340 | ||
283 | static bool tv_autoscroll_speed_setting(void) | ||
284 | { | ||
285 | return rb->set_int("Auto-scroll Speed", "", UNIT_INT, | ||
286 | &new_prefs.autoscroll_speed, NULL, 1, 1, 10, NULL); | ||
287 | } | ||
288 | |||
289 | MENUITEM_FUNCTION(encoding_item, 0, "Encoding", tv_encoding_setting, | 341 | MENUITEM_FUNCTION(encoding_item, 0, "Encoding", tv_encoding_setting, |
290 | NULL, NULL, Icon_NOICON); | 342 | NULL, NULL, Icon_NOICON); |
291 | MENUITEM_FUNCTION(word_wrap_item, 0, "Word Wrap", tv_word_wrap_setting, | 343 | MENUITEM_FUNCTION(word_wrap_item, 0, "Word Wrap", tv_word_wrap_setting, |
@@ -297,8 +349,6 @@ MENUITEM_FUNCTION(windows_item, 0, "Screens Per Page", tv_windows_setting, | |||
297 | MENUITEM_FUNCTION(alignment_item, 0, "Alignment", tv_alignment_setting, | 349 | MENUITEM_FUNCTION(alignment_item, 0, "Alignment", tv_alignment_setting, |
298 | NULL, NULL, Icon_NOICON); | 350 | NULL, NULL, Icon_NOICON); |
299 | #ifdef HAVE_LCD_BITMAP | 351 | #ifdef HAVE_LCD_BITMAP |
300 | MENUITEM_FUNCTION(page_mode_item, 0, "Overlap Pages", tv_page_mode_setting, | ||
301 | NULL, NULL, Icon_NOICON); | ||
302 | MENUITEM_FUNCTION(header_item, 0, "Show Header", tv_header_setting, | 352 | MENUITEM_FUNCTION(header_item, 0, "Show Header", tv_header_setting, |
303 | NULL, NULL, Icon_NOICON); | 353 | NULL, NULL, Icon_NOICON); |
304 | MENUITEM_FUNCTION(footer_item, 0, "Show Footer", tv_footer_setting, | 354 | MENUITEM_FUNCTION(footer_item, 0, "Show Footer", tv_footer_setting, |
@@ -306,17 +356,14 @@ MENUITEM_FUNCTION(footer_item, 0, "Show Footer", tv_footer_setting, | |||
306 | MENUITEM_FUNCTION(font_item, 0, "Font", tv_font_setting, | 356 | MENUITEM_FUNCTION(font_item, 0, "Font", tv_font_setting, |
307 | NULL, NULL, Icon_NOICON); | 357 | NULL, NULL, Icon_NOICON); |
308 | #endif | 358 | #endif |
309 | MENUITEM_FUNCTION(scroll_mode_item, 0, "Scroll Mode", tv_scroll_mode_setting, | 359 | |
310 | NULL, NULL, Icon_NOICON); | ||
311 | MENUITEM_FUNCTION(autoscroll_speed_item, 0, "Auto-Scroll Speed", | ||
312 | tv_autoscroll_speed_setting, NULL, NULL, Icon_NOICON); | ||
313 | MAKE_MENU(option_menu, "Viewer Options", NULL, Icon_NOICON, | 360 | MAKE_MENU(option_menu, "Viewer Options", NULL, Icon_NOICON, |
314 | &encoding_item, &word_wrap_item, &line_mode_item, &windows_item, | 361 | &encoding_item, &word_wrap_item, &line_mode_item, &windows_item, |
315 | &alignment_item, | 362 | &alignment_item, |
316 | #ifdef HAVE_LCD_BITMAP | 363 | #ifdef HAVE_LCD_BITMAP |
317 | &scrollbar_menu, &page_mode_item, &header_item, &footer_item, &font_item, | 364 | &header_item, &footer_item, &font_item, |
318 | #endif | 365 | #endif |
319 | &scroll_mode_item, &autoscroll_speed_item); | 366 | &scroll_menu); |
320 | 367 | ||
321 | static enum tv_menu_result tv_options_menu(void) | 368 | static enum tv_menu_result tv_options_menu(void) |
322 | { | 369 | { |
diff --git a/apps/plugins/text_viewer/tv_preferences.c b/apps/plugins/text_viewer/tv_preferences.c index ad4b0aa12b..62a700b85d 100644 --- a/apps/plugins/text_viewer/tv_preferences.c +++ b/apps/plugins/text_viewer/tv_preferences.c | |||
@@ -38,7 +38,8 @@ static void tv_notify_change_preferences(const struct tv_preferences *oldp, | |||
38 | /* | 38 | /* |
39 | * the following items do not check. | 39 | * the following items do not check. |
40 | * - alignment | 40 | * - alignment |
41 | * - scroll_mode | 41 | * - horizontal_scroll_mode |
42 | * - vertical_scroll_mode | ||
42 | * - page_mode | 43 | * - page_mode |
43 | * - font | 44 | * - font |
44 | * - autoscroll_speed | 45 | * - autoscroll_speed |
@@ -94,7 +95,8 @@ void tv_set_default_preferences(struct tv_preferences *p) | |||
94 | p->line_mode = NORMAL; | 95 | p->line_mode = NORMAL; |
95 | p->windows = 1; | 96 | p->windows = 1; |
96 | p->alignment = LEFT; | 97 | p->alignment = LEFT; |
97 | p->scroll_mode = PAGE; | 98 | p->horizontal_scroll_mode = SCREEN; |
99 | p->vertical_scroll_mode = PAGE; | ||
98 | p->page_mode = NO_OVERLAP; | 100 | p->page_mode = NO_OVERLAP; |
99 | p->horizontal_scrollbar = SB_OFF; | 101 | p->horizontal_scrollbar = SB_OFF; |
100 | p->vertical_scrollbar = SB_OFF; | 102 | p->vertical_scrollbar = SB_OFF; |
diff --git a/apps/plugins/text_viewer/tv_preferences.h b/apps/plugins/text_viewer/tv_preferences.h index ca02c2b5c9..dc29dcae26 100644 --- a/apps/plugins/text_viewer/tv_preferences.h +++ b/apps/plugins/text_viewer/tv_preferences.h | |||
@@ -71,9 +71,14 @@ struct tv_preferences { | |||
71 | } footer_mode; | 71 | } footer_mode; |
72 | 72 | ||
73 | enum { | 73 | enum { |
74 | PAGE=0, | 74 | SCREEN = 0, |
75 | COLUMN, | ||
76 | } horizontal_scroll_mode; | ||
77 | |||
78 | enum { | ||
79 | PAGE = 0, | ||
75 | LINE, | 80 | LINE, |
76 | } scroll_mode; | 81 | } vertical_scroll_mode; |
77 | 82 | ||
78 | int autoscroll_speed; | 83 | int autoscroll_speed; |
79 | 84 | ||
diff --git a/apps/plugins/text_viewer/tv_settings.c b/apps/plugins/text_viewer/tv_settings.c index bf6ae1e74a..b537b3fb40 100644 --- a/apps/plugins/text_viewer/tv_settings.c +++ b/apps/plugins/text_viewer/tv_settings.c | |||
@@ -47,7 +47,8 @@ | |||
47 | * scroll_mode 1 | 47 | * scroll_mode 1 |
48 | * autoscroll_speed 1 | 48 | * autoscroll_speed 1 |
49 | * horizontal_scrollbar 1 | 49 | * horizontal_scrollbar 1 |
50 | * (reserved) 15 | 50 | * horizontal_scroll_mode 1 |
51 | * (reserved) 14 | ||
51 | * font name MAX_PATH | 52 | * font name MAX_PATH |
52 | */ | 53 | */ |
53 | 54 | ||
@@ -55,7 +56,7 @@ | |||
55 | #define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" | 56 | #define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" |
56 | 57 | ||
57 | #define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ | 58 | #define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ |
58 | #define TV_GLOBAL_SETTINGS_VERSION 0x34 | 59 | #define TV_GLOBAL_SETTINGS_VERSION 0x35 |
59 | #define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 | 60 | #define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 |
60 | #define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 | 61 | #define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 |
61 | 62 | ||
@@ -86,7 +87,8 @@ | |||
86 | * scroll_mode 1 | 87 | * scroll_mode 1 |
87 | * autoscroll_speed 1 | 88 | * autoscroll_speed 1 |
88 | * horizontal_scrollbar 1 | 89 | * horizontal_scrollbar 1 |
89 | * (reserved) 15 | 90 | * horizontal_scroll_mode 1 |
91 | * (reserved) 14 | ||
90 | * font name MAX_PATH | 92 | * font name MAX_PATH |
91 | * bookmark count 1 | 93 | * bookmark count 1 |
92 | * [1st bookmark] | 94 | * [1st bookmark] |
@@ -108,7 +110,7 @@ | |||
108 | #define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" | 110 | #define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" |
109 | 111 | ||
110 | #define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ | 112 | #define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ |
111 | #define TV_SETTINGS_VERSION 0x35 | 113 | #define TV_SETTINGS_VERSION 0x36 |
112 | #define TV_SETTINGS_HEADER_SIZE 4 | 114 | #define TV_SETTINGS_HEADER_SIZE 4 |
113 | #define TV_SETTINGS_FIRST_VERSION 0x32 | 115 | #define TV_SETTINGS_FIRST_VERSION 0x32 |
114 | 116 | ||
@@ -149,17 +151,22 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre | |||
149 | prefs->vertical_scrollbar = *p++; | 151 | prefs->vertical_scrollbar = *p++; |
150 | /* skip need_scrollbar */ | 152 | /* skip need_scrollbar */ |
151 | p++; | 153 | p++; |
152 | prefs->page_mode = *p++; | 154 | prefs->page_mode = *p++; |
153 | prefs->header_mode = *p++; | 155 | prefs->header_mode = *p++; |
154 | prefs->footer_mode = *p++; | 156 | prefs->footer_mode = *p++; |
155 | prefs->scroll_mode = *p++; | 157 | prefs->vertical_scroll_mode = *p++; |
156 | prefs->autoscroll_speed = *p++; | 158 | prefs->autoscroll_speed = *p++; |
157 | 159 | ||
158 | if (version > 2) | 160 | if (version > 2) |
159 | prefs->horizontal_scrollbar = *p; | 161 | prefs->horizontal_scrollbar = *p; |
160 | else | 162 | else |
161 | prefs->horizontal_scrollbar = SB_OFF; | 163 | prefs->horizontal_scrollbar = SB_OFF; |
162 | 164 | ||
165 | if (version > 3) | ||
166 | prefs->horizontal_scroll_mode = *p++; | ||
167 | else | ||
168 | prefs->horizontal_scroll_mode = SCREEN; | ||
169 | |||
163 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); | 170 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); |
164 | 171 | ||
165 | #ifdef HAVE_LCD_BITMAP | 172 | #ifdef HAVE_LCD_BITMAP |
@@ -185,9 +192,10 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs) | |||
185 | *p++ = prefs->page_mode; | 192 | *p++ = prefs->page_mode; |
186 | *p++ = prefs->header_mode; | 193 | *p++ = prefs->header_mode; |
187 | *p++ = prefs->footer_mode; | 194 | *p++ = prefs->footer_mode; |
188 | *p++ = prefs->scroll_mode; | 195 | *p++ = prefs->vertical_scroll_mode; |
189 | *p++ = prefs->autoscroll_speed; | 196 | *p++ = prefs->autoscroll_speed; |
190 | *p++ = prefs->horizontal_scrollbar; | 197 | *p++ = prefs->horizontal_scrollbar; |
198 | *p++ = prefs->horizontal_scroll_mode; | ||
191 | 199 | ||
192 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); | 200 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); |
193 | 201 | ||