xref: /freebsd/contrib/ncurses/include/curses.wide (revision d056fa046c6a91b90cd98165face0e42a33a5173)
1
2#ifdef _XOPEN_SOURCE_EXTENDED
3
4/* $Id: curses.wide,v 1.23 2002/05/11 22:25:33 tom Exp $ */
5
6extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
7
8#define WACS_BSSB	(&_nc_wacs['l'])
9#define WACS_SSBB	(&_nc_wacs['m'])
10#define WACS_BBSS	(&_nc_wacs['k'])
11#define WACS_SBBS	(&_nc_wacs['j'])
12#define WACS_SBSS	(&_nc_wacs['u'])
13#define WACS_SSSB	(&_nc_wacs['t'])
14#define WACS_SSBS	(&_nc_wacs['v'])
15#define WACS_BSSS	(&_nc_wacs['w'])
16#define WACS_BSBS	(&_nc_wacs['q'])
17#define WACS_SBSB	(&_nc_wacs['x'])
18#define WACS_SSSS	(&_nc_wacs['n'])
19
20#define WACS_ULCORNER	WACS_BSSB
21#define WACS_LLCORNER	WACS_SSBB
22#define WACS_URCORNER	WACS_BBSS
23#define WACS_LRCORNER	WACS_SBBS
24#define WACS_RTEE	WACS_SBSS
25#define WACS_LTEE	WACS_SSSB
26#define WACS_BTEE	WACS_SSBS
27#define WACS_TTEE	WACS_BSSS
28#define WACS_HLINE	WACS_BSBS
29#define WACS_VLINE	WACS_SBSB
30#define WACS_PLUS	WACS_SSSS
31
32#define WACS_S1		(&_nc_wacs['o']) /* scan line 1 */
33#define WACS_S9 	(&_nc_wacs['s']) /* scan line 9 */
34#define WACS_DIAMOND	(&_nc_wacs['`']) /* diamond */
35#define WACS_CKBOARD	(&_nc_wacs['a']) /* checker board */
36#define WACS_DEGREE	(&_nc_wacs['f']) /* degree symbol */
37#define WACS_PLMINUS	(&_nc_wacs['g']) /* plus/minus */
38#define WACS_BULLET	(&_nc_wacs['~']) /* bullet */
39
40	/* Teletype 5410v1 symbols */
41#define WACS_LARROW	(&_nc_wacs[',']) /* arrow left */
42#define WACS_RARROW	(&_nc_wacs['+']) /* arrow right */
43#define WACS_DARROW	(&_nc_wacs['.']) /* arrow down */
44#define WACS_UARROW	(&_nc_wacs['-']) /* arrow up */
45#define WACS_BOARD	(&_nc_wacs['h']) /* board of squares */
46#define WACS_LANTERN	(&_nc_wacs['i']) /* lantern symbol */
47#define WACS_BLOCK	(&_nc_wacs['0']) /* solid square block */
48
49	/* ncurses extensions */
50#define WACS_S3		(&_nc_wacs['p']) /* scan line 3 */
51#define WACS_S7		(&_nc_wacs['r']) /* scan line 7 */
52#define WACS_LEQUAL	(&_nc_wacs['y']) /* less/equal */
53#define WACS_GEQUAL	(&_nc_wacs['z']) /* greater/equal */
54#define WACS_PI		(&_nc_wacs['{']) /* Pi */
55#define WACS_NEQUAL	(&_nc_wacs['|']) /* not equal */
56#define WACS_STERLING	(&_nc_wacs['}']) /* UK pound sign */
57
58/*
59 * Function prototypes for wide-character operations.
60 *
61 * "generated" comments should include ":WIDEC" to make the corresponding
62 * functions ifdef'd in lib_gen.c
63 *
64 * "implemented" comments do not need this marker.
65 */
66
67extern NCURSES_EXPORT(int) add_wch (const cchar_t *);			/* generated:WIDEC */
68extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int);		/* generated:WIDEC */
69extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *);		/* generated:WIDEC */
70extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int);		/* generated:WIDEC */
71extern NCURSES_EXPORT(int) addwstr (const wchar_t *);			/* generated:WIDEC */
72extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *);			/* generated:WIDEC */
73extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *);		/* generated:WIDEC */
74extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */
75extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *);	/* generated:WIDEC */
76extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *);		/* generated:WIDEC */
77extern NCURSES_EXPORT(int) erasewchar (wchar_t*);			/* implemented:WIDEC */
78extern NCURSES_EXPORT(int) get_wch (wint_t *);				/* generated:WIDEC */
79extern NCURSES_EXPORT(int) get_wstr (wint_t *);				/* generated:WIDEC */
80extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *);			/* generated:WIDEC */
81extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*);	/* implemented */
82extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int);			/* generated:WIDEC */
83extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int);		/* generated:WIDEC */
84extern NCURSES_EXPORT(int) in_wch (NCURSES_CONST cchar_t *);		/* generated:WIDEC */
85extern NCURSES_EXPORT(int) in_wchnstr (NCURSES_CONST cchar_t *, int);	/* generated:WIDEC */
86extern NCURSES_EXPORT(int) in_wchstr (NCURSES_CONST cchar_t *);		/* generated:WIDEC */
87extern NCURSES_EXPORT(int) innwstr (wchar_t *, int);			/* generated:WIDEC */
88extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int);		/* generated:WIDEC */
89extern NCURSES_EXPORT(int) ins_wch (const cchar_t *);			/* generated:WIDEC */
90extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *);			/* generated:WIDEC */
91extern NCURSES_EXPORT(int) inwstr (wchar_t *);				/* generated:WIDEC */
92extern NCURSES_EXPORT(char*) key_name (wchar_t);			/* implemented */
93extern NCURSES_EXPORT(int) killwchar (wchar_t *);			/* implemented:WIDEC */
94extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *);	/* generated:WIDEC */
95extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */
96extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *);	/* generated:WIDEC */
97extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int);	/* generated:WIDEC */
98extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *);	/* generated:WIDEC */
99extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *);		/* generated:WIDEC */
100extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *);		/* generated:WIDEC */
101extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int);	/* generated:WIDEC */
102extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int);	/* generated:WIDEC */
103extern NCURSES_EXPORT(int) mvin_wch (int, int, NCURSES_CONST cchar_t *);	/* generated:WIDEC */
104extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, NCURSES_CONST cchar_t *, int);	/* generated:WIDEC */
105extern NCURSES_EXPORT(int) mvin_wchstr (int, int, NCURSES_CONST cchar_t *);	/* generated:WIDEC */
106extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int);	/* generated:WIDEC */
107extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int);	/* generated:WIDEC */
108extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *);	/* generated:WIDEC */
109extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *);	/* generated:WIDEC */
110extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *);		/* generated:WIDEC */
111extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int);	/* generated:WIDEC */
112extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
113extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */
114extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
115extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */
116extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *);	/* generated:WIDEC */
117extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *);	/* generated:WIDEC */
118extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *);	/* generated:WIDEC */
119extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */
120extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */
121extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, NCURSES_CONST cchar_t *);	/* generated:WIDEC */
122extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* generated:WIDEC */
123extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, NCURSES_CONST cchar_t *);	/* generated:WIDEC */
124extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int);	/* generated:WIDEC */
125extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */
126extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
127extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *);	/* generated:WIDEC */
128extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *);		/* generated:WIDEC */
129extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */
130extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *);	/* missing */
131extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *);	/* implemented */
132extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int);	/* missing */
133extern NCURSES_EXPORT(attr_t) term_attrs (void);			/* implemented:WIDEC */
134extern NCURSES_EXPORT(int) unget_wch (const wchar_t);			/* implemented:WIDEC */
135extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *);		/* implemented:WIDEC */
136extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented:WIDEC */
137extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int);		/* generated:WIDEC */
138extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *);		/* implemented */
139extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int);	/* implemented */
140extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *);	/* generated:WIDEC */
141extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int);	/* implemented */
142extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *);		/* generated:WIDEC */
143extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *);		/* implemented */
144extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *);	/* implemented */
145extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*);	/* implemented */
146extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *);	/* implemented */
147extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *);		/* implemented */
148extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *);		/* generated:WIDEC */
149extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *);		/* implemented */
150extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int);		/* implemented */
151extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int);	/* implemented */
152extern NCURSES_EXPORT(int) win_wch (WINDOW *, NCURSES_CONST cchar_t *);	/* implemented */
153extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, NCURSES_CONST cchar_t *, int);	/* implemented */
154extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, NCURSES_CONST cchar_t *);	/* generated:WIDEC */
155extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int);		/* implemented */
156extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int);	/* implemented */
157extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *);	/* implemented */
158extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *);	/* generated:WIDEC */
159extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *);		/* implemented */
160extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *);			/* implemented */
161extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int);	/* implemented */
162
163/*
164 * XSI curses macros for XPG4 conformance.
165 */
166#define add_wch(c)			wadd_wch(stdscr,c)
167#define add_wchnstr(str,n)		wadd_wchnstr(stdscr,str,n)
168#define add_wchstr(str)			wadd_wchstr(stdscr,str)
169#define addnwstr(wstr,n)		waddnwstr(stdscr,wstr,n)
170#define addwstr(wstr)			waddwstr(stdscr,wstr)
171#define bkgrnd(c)			wbkgrnd(stdscr,c)
172#define bkgrndset(c)			wbkgrndset(stdscr,c)
173#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br)
174#define box_set(w,v,h)			wborder_set(w,v,v,h,h,0,0,0,0)
175#define echo_wchar(c)			wecho_wchar(stdscr,c)
176#define get_wch(c)			wget_wch(stdscr,c)
177#define get_wstr(t)			wget_wstr(stdscr,t)
178#define getbkgrnd(wch)			wgetbkgrnd(stdscr,wch)
179#define getn_wstr(t,n)			wgetn_wstr(stdscr,t,n)
180#define hline_set(c,n)			whline_set(stdscr,c,n)
181#define in_wch(c)			win_wch(stdscr,c)
182#define in_wchnstr(c,n)			win_wchnstr(stdscr,c,n)
183#define in_wchstr(c)			win_wchstr(stdscr,c)
184#define innwstr(c,n)			winnwstr(stdscr,c,n)
185#define ins_nwstr(t,n)			wins_nwstr(stdscr,t,n)
186#define ins_wch(c)			wins_wch(stdscr,c)
187#define ins_wstr(t)			wins_wstr(stdscr,t)
188#define inwstr(c)			winwstr(stdscr,c)
189#define vid_attr(a,pair,opts)		vidattr(a)
190#define vline_set(c,n)			wvline_set(stdscr,c,n)
191#define wadd_wchstr(win,str)		wadd_wchnstr(win,str,-1)
192#define waddwstr(win,wstr)		waddnwstr(win,wstr,-1)
193#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
194#define wget_wstr(w,t)			wgetn_wstr(w,t,-1)
195#define wgetbkgrnd(win,wch)		(*wch = win->_bkgrnd, OK)
196#define win_wchstr(w,c)			win_wchnstr(w,c,-1)
197#define wins_wstr(w,t)			wins_nwstr(w,t,-1)
198
199#define mvadd_wch(y,x,c)		mvwadd_wch(stdscr,y,x,c)
200#define mvadd_wchnstr(y,x,s,n)		mvwadd_wchnstr(stdscr,y,x,s,n)
201#define mvadd_wchstr(y,x,s)		mvwadd_wchstr(stdscr,y,x,s)
202#define mvaddnwstr(y,x,wstr,n)		mvwaddnwstr(stdscr,y,x,wstr,n)
203#define mvaddwstr(y,x,wstr)		mvwaddwstr(stdscr,y,x,wstr)
204#define mvget_wch(y,x,c)		mvwget_wch(stdscr,y,x,c)
205#define mvget_wstr(y,x,t)		mvwget_wstr(stdscr,y,x,t)
206#define mvgetn_wstr(y,x,t,n)		mvwgetn_wstr(stdscr,y,x,t,n)
207#define mvhline_set(y,x,c,n)		mvwhline_set(stdscr,y,x,c,n)
208#define mvin_wch(y,x,c)			mvwin_wch(stdscr,y,x,c)
209#define mvin_wchnstr(y,x,c,n)		mvwin_wchnstr(stdscr,y,x,c,n)
210#define mvin_wchstr(y,x,c)		mvwin_wchstr(stdscr,y,x,c)
211#define mvinnwstr(y,x,c,n)		mvwinnwstr(stdscr,y,x,c,n)
212#define mvins_nwstr(y,x,t,n)		mvwins_nwstr(stdscr,y,x,t,n)
213#define mvins_wch(y,x,c)		mvwins_wch(stdscr,y,x,c)
214#define mvins_wstr(y,x,t)		mvwins_wstr(stdscr,y,x,t)
215#define mvinwstr(y,x,c)			mvwinwstr(stdscr,y,x,c)
216#define mvvline_set(y,x,c,n)		mvwvline_set(stdscr,y,x,c,n)
217
218#define mvwadd_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c))
219#define mvwadd_wchnstr(win,y,x,s,n)	(wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n))
220#define mvwadd_wchstr(win,y,x,s)	(wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s))
221#define mvwaddnwstr(win,y,x,wstr,n)	(wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n))
222#define mvwaddwstr(win,y,x,wstr)	(wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr))
223#define mvwget_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wget_wch(win,c))
224#define mvwget_wstr(win,y,x,t)		(wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t))
225#define mvwgetn_wstr(win,y,x,t,n)	(wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n))
226#define mvwhline_set(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n))
227#define mvwin_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : win_wch(win,c))
228#define mvwin_wchnstr(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n))
229#define mvwin_wchstr(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c))
230#define mvwinnwstr(win,y,x,c,n)		(wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n))
231#define mvwins_nwstr(win,y,x,t,n)	(wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n))
232#define mvwins_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wins_wch(win,c))
233#define mvwins_wstr(win,y,x,t)		(wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t))
234#define mvwinwstr(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : winwstr(win,c))
235#define mvwvline_set(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n))
236
237#endif /* _XOPEN_SOURCE_EXTENDED */
238