1 /* ncmpc (Ncurses MPD Client)
2 * (c) 2004-2009 The Music Player Daemon Project
3 * Project homepage: http://musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifdef HAVE_NCURSESW_NCURSES_H
28 #include <ncursesw/ncurses.h>
35 /* completion callback data */
36 extern void *wrln_completion_callback_data
;
38 /* called after TAB is pressed but before g_completion_complete */
39 typedef void (*wrln_gcmp_pre_cb_t
) (GCompletion
*gcmp
, gchar
*buf
, void *data
);
40 extern wrln_gcmp_pre_cb_t wrln_pre_completion_callback
;
42 /* post completion callback */
43 typedef void (*wrln_gcmp_post_cb_t
) (GCompletion
*gcmp
, gchar
*s
, GList
*l
,
45 extern wrln_gcmp_post_cb_t wrln_post_completion_callback
;
49 /* Note, wreadln calls curs_set() and noecho(), to enable cursor and
50 * disable echo. wreadln will not restore these settings when exiting! */
51 gchar
*wreadln(WINDOW
*w
, /* the curses window to use */
52 const gchar
*prompt
, /* the prompt string or NULL */
53 const gchar
*initial_value
, /* initial value or NULL for a empty line
54 * (char *) -1 = get value from history */
55 unsigned x1
, /* the maximum x position or 0 */
56 GList
**history
, /* a pointer to a history list or NULL */
57 GCompletion
*gcmp
/* a GCompletion structure or NULL */
61 wreadln_masked(WINDOW
*w
,
63 const gchar
*initial_value
,