diff options
author | pav <pav@FreeBSD.org> | 2005-07-13 16:16:24 +0000 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2005-07-13 16:16:24 +0000 |
commit | 242533d35a5af8daf1a954078ea4b82c3f67c5e6 (patch) | |
tree | 6d00081113bd66477218998461624374aceca276 /audio/juke | |
parent | 638ecb1b6dfadfed1d756204f06af5e05d9a28a0 (diff) | |
download | FreeBSD-ports-242533d35a5af8daf1a954078ea4b82c3f67c5e6.zip FreeBSD-ports-242533d35a5af8daf1a954078ea4b82c3f67c5e6.tar.gz |
- Add optional patch to provide vi style key bindings
PR: ports/82417
Submitted by: Ed Schouten <ed@fxq.nl>
Approved by: maintainer timeout (2 weeks)
Diffstat (limited to 'audio/juke')
-rw-r--r-- | audio/juke/Makefile | 4 | ||||
-rw-r--r-- | audio/juke/files/extra-patch-vi | 200 |
2 files changed, 204 insertions, 0 deletions
diff --git a/audio/juke/Makefile b/audio/juke/Makefile index 390f9ae..4a38d82 100644 --- a/audio/juke/Makefile +++ b/audio/juke/Makefile @@ -18,6 +18,10 @@ GNU_CONFIGURE= yes MAN1= juke.1 +.if defined(WITH_VI_BINDINGS) +EXTRA_PATCHES= ${FILESDIR}/extra-patch-vi +.endif + post-install: ${INSTALL_DATA} ${WRKSRC}/juke.conf ${PREFIX}/etc/juke.conf.sample @${SED} 's,PREFIX,${PREFIX},' ${PKGMESSAGE} diff --git a/audio/juke/files/extra-patch-vi b/audio/juke/files/extra-patch-vi new file mode 100644 index 0000000..95c9310 --- /dev/null +++ b/audio/juke/files/extra-patch-vi @@ -0,0 +1,200 @@ +--- src/tui.c.orig Sun Feb 11 20:28:53 2001 ++++ src/tui.c Sun Jul 3 15:01:30 2005 +@@ -302,8 +302,8 @@ + + + /* Move cursor and update screen as needed +- * mode is one of CURSOR_UP, CURSOR_DOWN, CURSOR_PG_UP, CURSOR_PG_DOWN +- * or CURSOR_REDRAW ++ * mode is one of CURSOR_UP, CURSOR_DOWN, CURSOR_PG_UP, CURSOR_PG_DOWN, ++ * CURSOR_TOP, CURSOR_BOTTOM or CURSOR_REDRAW + */ + + static void tui_move_cursor (struct TUI *tui, int mode) +@@ -360,6 +360,24 @@ + refresh (); + } + break; ++ ++ case CURSOR_TOP: ++ if (d->cursor > 0) { ++ mvaddch (d->cursor - d->base + 2, 1, ' '); ++ tui_upd_y (d, tui, -d->cursor, 0); ++ mvaddch (d->cursor - d->base + 2, 1, '*'); ++ refresh (); ++ } ++ break; ++ ++ case CURSOR_BOTTOM: ++ if (d->cursor < (d->items - 1)) { ++ mvaddch (d->cursor - d->base + 2, 1, ' '); ++ tui_upd_y (d, tui, d->items - d->cursor - 1, 0); ++ mvaddch (d->cursor - d->base + 2, 1, '*'); ++ refresh (); ++ } ++ break; + + case CURSOR_REDRAW: + if (d->items) { +@@ -382,22 +400,24 @@ + { + static char help[] = {" (help)\n" + "\n" +- "I a add tune\n" +- " b page up\n" ++ " a add tune\n" ++ " ^B page up\n" + " c clear queue\n" + " d delete tune\n" +- " h help message\n" +- " i up\n" +- "I j left\n" +- " k down\n" +- "I l right\n" ++ " ^F page down\n" ++ " g go to top\n" ++ " G go to bottom\n" ++ " h left\n" ++ " j down\n" ++ " k up\n" ++ " l right\n" + " m move to top\n" + " p pause\n" + " q quit\n" + " r randomize\n" + " s skip tune\n" + " t toggle display\n" +- " sp page down\n" ++ " ? help message\n" + "\n" + " <press any key>"}; + +@@ -733,72 +753,68 @@ + + switch (key) { + case KEY_NPAGE: ++ case 0x06: /* ^F */ + case ' ': + tui_move_cursor (tui, CURSOR_PG_DOWN); + break; + + case 'a': +- case 'A': + tui_add_to_queue (tui); + break; + + case KEY_PPAGE: +- case 'b': +- case 'B': ++ case 0x02: /* ^B */ + tui_move_cursor (tui, CURSOR_PG_UP); + break; + + case 'c': +- case 'C': + tui_clear_queue (tui); + break; + + case 'd': +- case 'D': + tui_delete_from_queue (tui); + break; +- +- case 'h': +- case 'H': +- tui_help_screen (tui); ++ ++ case KEY_HOME: ++ case 'g': ++ tui_move_cursor (tui, CURSOR_TOP); + break; +- +- case KEY_UP: +- case 'i': +- case 'I': +- tui_move_cursor (tui, CURSOR_UP); ++ ++ case KEY_END: ++ case 'G': ++ tui_move_cursor (tui, CURSOR_BOTTOM); + break; + + case KEY_LEFT: +- case 'j': +- case 'J': ++ case 'h': + tui_leave_dir (tui); + break; + + case KEY_DOWN: +- case 'k': +- case 'K': ++ case 'j': + tui_move_cursor (tui, CURSOR_DOWN); + break; ++ ++ case KEY_UP: ++ case 'k': ++ tui_move_cursor (tui, CURSOR_UP); ++ break; ++ + + case KEY_RIGHT: + case 'l': +- case 'L': + tui_enter_dir (tui); + break; + + case 'm': +- case 'M': + tui_move_item (tui); + break; + + case 'p': +- case 'P': + tui->player->cmd = PLAYER_PAUSE; + break; + + case 'q': +- case 'Q': + tui_status_message (tui, "Quit? (y/n)"); + exit = tui_yes_no (); + if (!exit) { +@@ -810,20 +826,21 @@ + break; + + case 'r': +- case 'R': + tui_randomize_queue (tui); + break; + + case 's': +- case 'S': + tui->player->cmd = PLAYER_SKIP; + break; + + case 't': +- case 'T': + tui->dm ^= 1; + tui_redraw_status (tui); + tui_move_cursor (tui, CURSOR_REDRAW); ++ break; ++ ++ case '?': ++ tui_help_screen (tui); + } + } while (!exit); + } +--- src/tui.h.orig Sun Jun 27 15:16:20 1999 ++++ src/tui.h Sun Jul 3 14:14:20 2005 +@@ -16,7 +16,9 @@ + #define CURSOR_DOWN 3 + #define CURSOR_PG_UP 4 + #define CURSOR_PG_DOWN 5 +-#define CURSOR_REDRAW 6 ++#define CURSOR_TOP 6 ++#define CURSOR_BOTTOM 7 ++#define CURSOR_REDRAW 8 + + struct TUI_DISP { + int items; |