From 7d7a944c76715a8f36096beb76ba87febc5f9c09 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 7 Apr 2017 13:15:05 +0200 Subject: Clean up mupdf-gl usage message. --- platform/gl/gl-main.c | 103 +++++++++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 44 deletions(-) (limited to 'platform/gl/gl-main.c') diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index a013bdef..1d37a26c 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -887,9 +887,37 @@ static void do_app(void) { switch (ui.key) { - case 'q': - quit(); - break; + case KEY_F1: showhelp = !showhelp; break; + case 'o': toggle_outline(); break; + case 'L': showlinks = !showlinks; break; + case 'i': showinfo = !showinfo; break; + case 'r': reload(); break; + case 'q': quit(); break; + + case 'f': toggle_fullscreen(); break; + case 'w': shrinkwrap(); break; + case 'W': auto_zoom_w(); break; + case 'H': auto_zoom_h(); break; + case 'Z': auto_zoom(); break; + case 'z': currentzoom = number > 0 ? number : DEFRES; break; + case '+': currentzoom = zoom_in(currentzoom); break; + case '-': currentzoom = zoom_out(currentzoom); break; + case '[': currentrotate += 90; break; + case ']': currentrotate -= 90; break; + case 'k': case KEY_UP: scroll_y -= 10; break; + case 'j': case KEY_DOWN: scroll_y += 10; break; + case 'h': case KEY_LEFT: scroll_x -= 10; break; + case 'l': case KEY_RIGHT: scroll_x += 10; break; + + case 'b': number = fz_maxi(number, 1); while (number--) smart_move_backward(); break; + case ' ': number = fz_maxi(number, 1); while (number--) smart_move_forward(); break; + case ',': case KEY_PAGE_UP: currentpage -= fz_maxi(number, 1); break; + case '.': case KEY_PAGE_DOWN: currentpage += fz_maxi(number, 1); break; + case '<': currentpage -= 10 * fz_maxi(number, 1); break; + case '>': currentpage += 10 * fz_maxi(number, 1); break; + case 'g': jump_to_page(number - 1); break; + case 'G': jump_to_page(fz_count_pages(ctx, doc) - 1); break; + case 'm': if (number == 0) push_history(); @@ -914,6 +942,19 @@ static void do_app(void) pop_future(); } break; + + case '/': + search_dir = 1; + showsearch = 1; + search_input.p = search_input.text; + search_input.q = search_input.end; + break; + case '?': + search_dir = -1; + showsearch = 1; + search_input.p = search_input.text; + search_input.q = search_input.end; + break; case 'N': search_dir = -1; if (search_hit_page == currentpage) @@ -940,35 +981,6 @@ static void do_app(void) search_active = 1; } break; - case 'f': toggle_fullscreen(); break; - case 'w': shrinkwrap(); break; - case 'r': reload(); break; - case 'o': toggle_outline(); break; - case 'W': auto_zoom_w(); break; - case 'H': auto_zoom_h(); break; - case 'Z': auto_zoom(); break; - case 'z': currentzoom = number > 0 ? number : DEFRES; break; - case '<': currentpage -= 10 * fz_maxi(number, 1); break; - case '>': currentpage += 10 * fz_maxi(number, 1); break; - case ',': case KEY_PAGE_UP: currentpage -= fz_maxi(number, 1); break; - case '.': case KEY_PAGE_DOWN: currentpage += fz_maxi(number, 1); break; - case 'b': number = fz_maxi(number, 1); while (number--) smart_move_backward(); break; - case ' ': number = fz_maxi(number, 1); while (number--) smart_move_forward(); break; - case 'g': jump_to_page(number - 1); break; - case 'G': jump_to_page(fz_count_pages(ctx, doc) - 1); break; - case '+': currentzoom = zoom_in(currentzoom); break; - case '-': currentzoom = zoom_out(currentzoom); break; - case '[': currentrotate += 90; break; - case ']': currentrotate -= 90; break; - case 'L': showlinks = !showlinks; break; - case 'i': showinfo = !showinfo; break; - case '/': search_dir = 1; showsearch = 1; search_input.p = search_input.text; search_input.q = search_input.end; break; - case '?': search_dir = -1; showsearch = 1; search_input.p = search_input.text; search_input.q = search_input.end; break; - case 'k': case KEY_UP: scroll_y -= 10; break; - case 'j': case KEY_DOWN: scroll_y += 10; break; - case 'h': case KEY_LEFT: scroll_x -= 10; break; - case 'l': case KEY_RIGHT: scroll_x += 10; break; - case KEY_F1: showhelp = !showhelp; break; } if (ui.key >= '0' && ui.key <= '9') @@ -1064,7 +1076,7 @@ static void do_help(void) int x = canvas_x + 4 * ui.lineheight; int y = canvas_y + 4 * ui.lineheight; int w = canvas_w - 8 * ui.lineheight; - int h = 34 * ui.lineheight; + int h = 37 * ui.lineheight; glBegin(GL_TRIANGLE_STRIP); { @@ -1082,13 +1094,22 @@ static void do_help(void) glColor4f(0, 0, 0, 1); y = do_help_line(x, y, "MuPDF", FZ_VERSION); y += ui.lineheight; - y = do_help_line(x, y, "q", "quit"); - y = do_help_line(x, y, "r", "reload file"); - y = do_help_line(x, y, "f", "fullscreen window"); - y = do_help_line(x, y, "w", "shrink wrap window"); + y = do_help_line(x, y, "F1", "show this message"); y = do_help_line(x, y, "i", "show document information"); y = do_help_line(x, y, "o", "show/hide outline"); y = do_help_line(x, y, "L", "show/hide links"); + y = do_help_line(x, y, "r", "reload file"); + y = do_help_line(x, y, "q", "quit"); + y += ui.lineheight; + y = do_help_line(x, y, "f", "fullscreen window"); + y = do_help_line(x, y, "w", "shrink wrap window"); + y = do_help_line(x, y, "W or H", "fit to width or height"); + y = do_help_line(x, y, "Z", "fit to page"); + y = do_help_line(x, y, "z", "reset zoom"); + y = do_help_line(x, y, "N z", "set zoom to N"); + y = do_help_line(x, y, "+ or -", "zoom in or out"); + y = do_help_line(x, y, "[ or ]", "rotate left or right"); + y = do_help_line(x, y, "arrow keys", "pan in small increments"); y += ui.lineheight; y = do_help_line(x, y, "b", "smart move backward"); y = do_help_line(x, y, "Space", "smart move forward"); @@ -1103,15 +1124,9 @@ static void do_help(void) y = do_help_line(x, y, "T", "go forward in history"); y = do_help_line(x, y, "N m", "save location in bookmark N"); y = do_help_line(x, y, "N t", "go to bookmark N"); + y += ui.lineheight; y = do_help_line(x, y, "/ or ?", "search for text"); y = do_help_line(x, y, "n or N", "repeat search"); - y += ui.lineheight; - y = do_help_line(x, y, "[ or ]", "rotate left or right"); - y = do_help_line(x, y, "+ or -", "zoom in or out"); - y = do_help_line(x, y, "W or H", "fit to width or height"); - y = do_help_line(x, y, "Z", "fit to page"); - y = do_help_line(x, y, "z", "reset zoom"); - y = do_help_line(x, y, "N z", "set zoom to N"); } static void do_canvas(void) -- cgit v1.2.3