ncmpc  0.29
wreadln.h
Go to the documentation of this file.
1 /* ncmpc (Ncurses MPD Client)
2  * (c) 2004-2017 The Music Player Daemon Project
3  * Project homepage: http://musicpd.org
4  *
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.
9  *
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.
14  *
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.
18  */
19 
20 #ifndef WREADLN_H
21 #define WREADLN_H
22 
23 #include "config.h"
24 #include "ncmpc_curses.h"
25 
26 #include <glib.h>
27 
28 #ifndef NCMPC_MINI
29 
30 /* completion callback data */
32 
33 /* called after TAB is pressed but before g_completion_complete */
34 typedef void (*wrln_gcmp_pre_cb_t) (GCompletion *gcmp, gchar *buf, void *data);
36 
37 /* post completion callback */
38 typedef void (*wrln_gcmp_post_cb_t) (GCompletion *gcmp, gchar *s, GList *l,
39  void *data);
41 
42 #endif
43 
44 /* Note, wreadln calls curs_set() and noecho(), to enable cursor and
45  * disable echo. wreadln will not restore these settings when exiting! */
46 gchar *wreadln(WINDOW *w, /* the curses window to use */
47  const gchar *prompt, /* the prompt string or NULL */
48  const gchar *initial_value, /* initial value or NULL for a empty line
49  * (char *) -1 = get value from history */
50  unsigned x1, /* the maximum x position or 0 */
51  GList **history, /* a pointer to a history list or NULL */
52  GCompletion *gcmp /* a GCompletion structure or NULL */
53  );
54 
55 gchar *
56 wreadln_masked(WINDOW *w,
57  const gchar *prompt,
58  const gchar *initial_value,
59  unsigned x1,
60  GList **history,
61  GCompletion *gcmp);
62 
63 #endif
void(* wrln_gcmp_pre_cb_t)(GCompletion *gcmp, gchar *buf, void *data)
Definition: wreadln.h:34
void * wrln_completion_callback_data
gchar * wreadln(WINDOW *w, const gchar *prompt, const gchar *initial_value, unsigned x1, GList **history, GCompletion *gcmp)
gchar * wreadln_masked(WINDOW *w, const gchar *prompt, const gchar *initial_value, unsigned x1, GList **history, GCompletion *gcmp)
wrln_gcmp_pre_cb_t wrln_pre_completion_callback
wrln_gcmp_post_cb_t wrln_post_completion_callback
void(* wrln_gcmp_post_cb_t)(GCompletion *gcmp, gchar *s, GList *l, void *data)
Definition: wreadln.h:38