diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-09-07 20:25:08 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-09-07 20:25:08 +0000 |
commit | 420a65325b977440effcfd820b5a5f3b9f9698b1 (patch) | |
tree | 78b59c19d5e0621671c9d64ebef30d8a78c84713 /src/wreadln.c | |
parent | 299c6bd912709f5e27fd6a8a0e1bad1bfb3e279a (diff) | |
download | mpd-420a65325b977440effcfd820b5a5f3b9f9698b1.tar.gz mpd-420a65325b977440effcfd820b5a5f3b9f9698b1.tar.xz mpd-420a65325b977440effcfd820b5a5f3b9f9698b1.zip |
due to bensonk's demand i added a splash screen.
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/wreadln.c')
-rw-r--r-- | src/wreadln.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/wreadln.c b/src/wreadln.c index c3c5bfd06..380e87280 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -60,12 +60,13 @@ extern size_t my_strlen(char *str); /* libcurses version */ gchar * -wreadln(WINDOW *w, +_wreadln(WINDOW *w, gchar *prompt, gchar *initial_value, gint x1, GList **history, - GCompletion *gcmp) + GCompletion *gcmp, + gboolean masked) { GList *hlist = NULL, *hcurrent = NULL; gchar *line; @@ -103,7 +104,8 @@ wreadln(WINDOW *w, /* clear input area */ whline(w, ' ', width); /* print visible part of the line buffer */ - waddnstr(w, line+start, width); + if(masked == TRUE) whline(w, '*', my_strlen(line)-start); + else waddnstr(w, line+start, width); /* move the cursor to the correct position */ wmove(w, y, x0 + cursor-start); /* tell ncurses to redraw the screen */ @@ -365,12 +367,13 @@ wreadln(WINDOW *w, /* libcursesw version */ gchar * -wreadln(WINDOW *w, +_wreadln(WINDOW *w, gchar *prompt, gchar *initial_value, gint x1, GList **history, - GCompletion *gcmp) + GCompletion *gcmp, + gboolean masked) { GList *hlist = NULL, *hcurrent = NULL; wchar_t *wline; @@ -437,7 +440,8 @@ wreadln(WINDOW *w, /* clear input area */ whline(w, ' ', width); /* print visible part of the line buffer */ - waddnwstr(w, wline+start, width); + if(masked == TRUE) whline(w, '*', my_strlen(line)-start); + else waddnstr(w, line+start, width); /* move the cursor to the correct position */ wmove(w, y, x0 + cursor-start); /* tell ncurses to redraw the screen */ @@ -698,3 +702,25 @@ wreadln(WINDOW *w, } #endif + +gchar * +wreadln(WINDOW *w, + gchar *prompt, + gchar *initial_value, + gint x1, + GList **history, + GCompletion *gcmp) + { + return _wreadln(w, prompt, initial_value, x1, history, gcmp, FALSE); + } + +gchar * +wreadln_masked(WINDOW *w, + gchar *prompt, + gchar *initial_value, + gint x1, + GList **history, + GCompletion *gcmp) + { + return _wreadln(w, prompt, initial_value, x1, history, gcmp, TRUE); + } |