Code

520ba2a6a9ebfae981699db32c1e6760f6233b8a
[ncmpc.git] / src / wreadln.h
1 #ifndef WREADLN_H
2 #define WREADLN_H
4 /* max size allocated for a line */
5 extern unsigned int wrln_max_line_size;
7 /* max items stored in the history list */
8 extern unsigned int wrln_max_history_length;
10 /* a callback function for KEY_RESIZE */
11 extern GVoidFunc wrln_resize_callback;
13 /* called after TAB is pressed but before g_completion_complete */
14 typedef void (*wrln_gcmp_pre_cb_t) (GCompletion *gcmp, gchar *buf);
15 extern wrln_gcmp_pre_cb_t wrln_pre_completion_callback;
17 /* post completion callback */
18 typedef void (*wrln_gcmp_post_cb_t) (GCompletion *gcmp, gchar *s, GList *l);
19 extern wrln_gcmp_post_cb_t wrln_post_completion_callback;
21 /* Note, wreadln calls curs_set() and noecho(), to enable cursor and 
22  * disable echo. wreadln will not restore these settings when exiting! */
23 char *wreadln(WINDOW *w,           /* the curses window to use */
24               char *prompt,        /* the prompt string or NULL */
25               char *initial_value, /* initial value or NULL for a empty line
26                                     * (char *) -1 => get value from history */
27               int x1,              /* the maximum x position or 0 */
28               GList **history,     /* a pointer to a history list or NULL */ 
29               GCompletion *gcmp    /* a GCompletion structure or NULL */
30               );
33 #endif