summaryrefslogtreecommitdiff
path: root/apps/plugins/viewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/viewer.c')
-rw-r--r--apps/plugins/viewer.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index f58abdea53..514854db97 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -128,11 +128,20 @@ static unsigned char *word_mode_str[] = {"wrap", "chop", "words"};
128enum { 128enum {
129 NORMAL=0, 129 NORMAL=0,
130 JOIN, 130 JOIN,
131 REFLOW, 131#ifdef HAVE_LCD_BITMAP
132 REFLOW, /* Makes no sense for the player */
133#endif
132 EXPAND, 134 EXPAND,
133 LINE_MODES 135 LINE_MODES,
136#ifndef HAVE_LCD_BITMAP
137 REFLOW /* Sorting it behind LINE_MODES effectively disables it. */
138#endif
134} line_mode = 0; 139} line_mode = 0;
135static unsigned char *line_mode_str[] = {"normal", "join", "reflow", "expand", "lines"}; 140
141static unsigned char *line_mode_str[] = {
142 [NORMAL] = "normal", [JOIN] = "join", [REFLOW] = "reflow",
143 [EXPAND] = "expand", [LINE_MODES] = "lines"
144};
136 145
137enum { 146enum {
138 NARROW=0, 147 NARROW=0,
@@ -254,8 +263,8 @@ static unsigned char* find_next_line(const unsigned char* cur_line, bool *is_sho
254 next_line = NULL; 263 next_line = NULL;
255 first_chars=true; 264 first_chars=true;
256 for (j=k=width=spaces=newlines=0; ; j++) { 265 for (j=k=width=spaces=newlines=0; ; j++) {
257 if (BUFFER_OOB(cur_line+j)) 266 if (BUFFER_OOB(cur_line+j))
258 return NULL; 267 return NULL;
259 if (LINE_IS_FULL) { 268 if (LINE_IS_FULL) {
260 size = search_len = j; 269 size = search_len = j;
261 break; 270 break;
@@ -296,16 +305,16 @@ static unsigned char* find_next_line(const unsigned char* cur_line, bool *is_sho
296 305
297 default: 306 default:
298 if (line_mode==JOIN || newlines>0) { 307 if (line_mode==JOIN || newlines>0) {
299 while (spaces) { 308 while (spaces) {
300 spaces--; 309 spaces--;
301 ADVANCE_COUNTERS(' '); 310 ADVANCE_COUNTERS(' ');
302 if (LINE_IS_FULL) { 311 if (LINE_IS_FULL) {
303 size = search_len = j; 312 size = search_len = j;
304 break; 313 break;
305 } 314 }
306 } 315 }
307 newlines=0; 316 newlines=0;
308 } else if (spaces) { 317 } else if (spaces) {
309 /* REFLOW, multiple spaces between words: count only 318 /* REFLOW, multiple spaces between words: count only
310 * one. If more are needed, they will be added 319 * one. If more are needed, they will be added
311 * while drawing. */ 320 * while drawing. */