1 /*
2                                     __
3                                    / _|
4   __ _ _   _ _ __ ___  _ __ __ _  | |_ ___  ___ ___
5  / _` | | | | '__/ _ \| '__/ _` | |  _/ _ \/ __/ __|
6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \
7  \__,_|\__,_|_|  \___/|_|  \__,_| |_| \___/|___/___/
8 
9 Copyright (C) 1992,1995 Zeyd M. Ben-Halim <zmbenhal@netcom.com>
10 Copyright (C) 1992,1995 Eric S. Raymond <esr@snark.thyrsus.com>
11 Copyright (C) 1998-2016,2017 Free Software Foundation, Inc.
12 Copyright (C) 2018-2019 Aurora Free Open Source Software.
13 Copyright (C) 2018-2019 Luís Ferreira <luis@aurorafoss.org>
14 Copyright (C) 1996-on Thomas E. Dickey
15 
16 This file is part of the Aurora Free Open Source Software. This
17 organization promote free and open source software that you can
18 redistribute and/or modify under the terms of the GNU Lesser General
19 Public License Version 3 as published by the Free Software Foundation or
20 (at your option) any later version approved by the Aurora Free Open Source
21 Software Organization. The license is available in the package root path
22 as 'LICENSE' file. Please review the following information to ensure the
23 GNU Lesser General Public License version 3 requirements will be met:
24 https://www.gnu.org/licenses/lgpl.html .
25 
26 Alternatively, this file may be used under the terms of the GNU General
27 Public License version 3 or later as published by the Free Software
28 Foundation. Please review the following information to ensure the GNU
29 General Public License requirements will be met:
30 http://www.gnu.org/licenses/gpl-3.0.html.
31 
32 NOTE: All products, services or anything associated to trademarks and
33 service marks used or referenced on this file are the property of their
34 respective companies/owners or its subsidiaries. Other names and brands
35 may be claimed as the property of others.
36 
37 For more info about intellectual property visit: aurorafoss.org or
38 directly send an email to: contact (at) aurorafoss.org .
39 */
40 
41 module riverd.ncurses.types;
42 
43 import core.stdc.stdint;
44 import core.stdc.config;
45 import core.stdc.stdio;
46 import core.stdc.stdarg;
47 
48 import std.traits;
49 
50 
51 /* octal implementation */
52 private T octal(T)(const string num)
53 {
54 	T value = 0;
55 
56 	foreach (const char s; num)
57 	{
58 		if (s < '0' || s > '7')
59 			continue;
60 
61 		value *= 8;
62 		value += s - '0';
63 	}
64 
65 	return value;
66 }
67 
68 extern(C):
69 
70 enum CURSES = 1;
71 enum CURSES_H = 1;
72 
73 /* These are defined only in curses.h, and are used for conditional compiles */
74 enum NCURSES_VERSION_MAJOR = 6;
75 enum NCURSES_VERSION_MINOR = 1;
76 enum NCURSES_VERSION_PATCH = 20180127;
77 
78 /* This is defined in more than one ncurses header, for identification */
79 
80 enum NCURSES_VERSION = "6.1";
81 
82 /*
83  * Identify the mouse encoding version.
84  */
85 enum NCURSES_MOUSE_VERSION = 2;
86 
87 /*
88  * Definitions to facilitate DLL's.
89  */
90 
91 /*
92  * User-definable tweak to disable the include of <stdbool.h>.
93  */
94 
95 enum NCURSES_ENABLE_STDBOOL_H = 1;
96 
97 /*
98  * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
99  * configured using --disable-macros.
100  */
101 
102 alias NCURSES_ATTR_T = int;
103 
104 /*
105  * Expands to 'const' if ncurses is configured using --enable-const.  Note that
106  * doing so makes it incompatible with other implementations of X/Open Curses.
107  */
108 
109 /*
110  * The standard type used for color values, and for color-pairs.  The latter
111  * allows the curses library to enumerate the combinations of foreground and
112  * background colors used by an application, and is normally the product of the
113  * total foreground and background colors.
114  *
115  * X/Open uses "short" for both of these types, ultimately because they are
116  * numbers from the SVr4 terminal database, which uses 16-bit signed values.
117  */
118 
119 alias NCURSES_COLOR_T = short;
120 
121 alias NCURSES_PAIRS_T = short;
122 
123 /*
124  * Definitions used to make WINDOW and similar structs opaque.
125  */
126 
127 enum NCURSES_OPAQUE = 0;
128 enum NCURSES_OPAQUE_FORM = 0;
129 enum NCURSES_OPAQUE_MENU = 0;
130 enum NCURSES_OPAQUE_PANEL = 0;
131 
132 /*
133  * Definition used to optionally suppress wattr* macros to help with the
134  * transition from ncurses5 to ncurses6 by allowing the header files to
135  * be shared across development packages for ncursesw in both ABIs.
136  */
137 
138 enum NCURSES_WATTR_MACROS = 1;
139 
140 /*
141  * The reentrant code relies on the opaque setting, but adds features.
142  */
143 
144 enum NCURSES_REENTRANT = 0;
145 
146 /*
147  * Control whether bindings for interop support are added.
148  */
149 
150 enum NCURSES_INTEROP_FUNCS = 1;
151 
152 /*
153  * The internal type used for window dimensions.
154  */
155 
156 alias NCURSES_SIZE_T = short;
157 
158 /*
159  * Control whether tparm() supports varargs or fixed-parameter list.
160  */
161 
162 enum NCURSES_TPARM_VARARGS = 1;
163 
164 /*
165  * Control type used for tparm's arguments.  While X/Open equates long and
166  * char* values, this is not always workable for 64-bit platforms.
167  */
168 
169 alias NCURSES_TPARM_ARG = intptr_t;
170 
171 /*
172  * Control whether ncurses uses wcwidth() for checking width of line-drawing
173  * characters.
174  */
175 
176 enum NCURSES_WCWIDTH_GRAPHICS = 1;
177 
178 enum CCHARW_MAX = 5;
179 
180 struct cchar_t
181 {
182 	attr_t attr;
183 	wchar[CCHARW_MAX] chars;
184 	int ext_color; /* color pair, must be more than 16-bits */
185 }
186 
187 /*
188  * NCURSES_CH_T is used in building the library, but not used otherwise in
189  * this header file, since that would make the normal/wide-character versions
190  * of the header incompatible.
191  */
192 alias NCURSES_CH_T = cchar_t;
193 
194 alias chtype = uint;
195 alias mmask_t = uint;
196 
197 /*
198  * We need FILE, etc.  Include this before checking any feature symbols.
199  */
200 
201 /*
202  * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
203  * conflicting) when _XOPEN_SOURCE is 500 or greater.  If NCURSES_WIDECHAR is
204  * not already defined, e.g., if the platform relies upon nonstandard feature
205  * test macros, define it at this point if the standard feature test macros
206  * indicate that it should be defined.
207  */
208 
209 enum NCURSES_WIDECHAR = 0;
210 
211 /* NCURSES_WIDECHAR */
212 
213 /* we need va_list */
214 /* we want wchar_t */
215 
216 /* X/Open and SVr4 specify that curses implements 'bool'.  However, C++ may also
217  * implement it.  If so, we must use the C++ compiler's type to avoid conflict
218  * with other interfaces.
219  *
220  * A further complication is that <stdbool.h> may declare 'bool' to be a
221  * different type, such as an enum which is not necessarily compatible with
222  * C++.  If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
223  * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
224  * In either case, make a typedef for NCURSES_BOOL which can be used if needed
225  * from either C or C++.
226  */
227 
228 enum TRUE = 1;
229 enum FALSE = 0;
230 
231 alias NCURSES_BOOL = bool;
232 
233 /* there is no predefined bool - use our own */
234 
235 /* !__cplusplus, etc. */
236 
237 extern (D) T1 NCURSES_CAST(T1, T2)(auto ref T2 value)
238 {
239 	return cast(T1)(value);
240 }
241 
242 extern (D) auto NCURSES_OK_ADDR(T)(auto ref T p)
243 {
244 	return cast(const(void)*)0x0 != NCURSES_CAST!(const(void)*)(p);
245 }
246 
247 /*
248  * X/Open attributes.  In the ncurses implementation, they are identical to the
249  * A_ attributes.
250  */
251 enum WA_ATTRIBUTES = A_ATTRIBUTES;
252 enum WA_NORMAL = A_NORMAL;
253 enum WA_STANDOUT = A_STANDOUT;
254 enum WA_UNDERLINE = A_UNDERLINE;
255 enum WA_REVERSE = A_REVERSE;
256 enum WA_BLINK = A_BLINK;
257 enum WA_DIM = A_DIM;
258 enum WA_BOLD = A_BOLD;
259 enum WA_ALTCHARSET = A_ALTCHARSET;
260 enum WA_INVIS = A_INVIS;
261 enum WA_PROTECT = A_PROTECT;
262 enum WA_HORIZONTAL = A_HORIZONTAL;
263 enum WA_LEFT = A_LEFT;
264 enum WA_LOW = A_LOW;
265 enum WA_RIGHT = A_RIGHT;
266 enum WA_TOP = A_TOP;
267 enum WA_VERTICAL = A_VERTICAL;
268 
269 enum WA_ITALIC = A_ITALIC; /* ncurses extension */
270 
271 /* colors */
272 enum COLOR_BLACK = 0;
273 enum COLOR_RED = 1;
274 enum COLOR_GREEN = 2;
275 enum COLOR_YELLOW = 3;
276 enum COLOR_BLUE = 4;
277 enum COLOR_MAGENTA = 5;
278 enum COLOR_CYAN = 6;
279 enum COLOR_WHITE = 7;
280 
281 /* line graphics */
282 
283 extern __gshared chtype[256] acs_map;
284 
285 
286 /* acs symbols */
287 
288 /* VT100 symbols begin here */
289 
290 @property auto ACS_ULCORNER()()
291 {   return acs_map[cast(ubyte)'l']; }
292 @property auto ACS_LLCORNER()()
293 {   return acs_map[cast(ubyte)'m']; }
294 @property auto ACS_URCORNER()()
295 {   return acs_map[cast(ubyte)'k']; }
296 @property auto ACS_LRCORNER()()
297 {   return acs_map[cast(ubyte)'j']; }
298 @property auto ACS_LTEE()()
299 {   return acs_map[cast(ubyte)'t']; }
300 @property auto ACS_RTEE()()
301 {   return acs_map[cast(ubyte)'u']; }
302 @property auto ACS_BTEE()()
303 {   return acs_map[cast(ubyte)'v']; }
304 @property auto ACS_TTEE()()
305 {   return acs_map[cast(ubyte)'w']; }
306 @property auto ACS_HLINE()()
307 {   return acs_map[cast(ubyte)'q']; }
308 @property auto ACS_VLINE()()
309 {   return acs_map[cast(ubyte)'x']; }
310 @property auto ACS_PLUS()()
311 {   return acs_map[cast(ubyte)'n']; }
312 @property auto ACS_S1()()
313 {   return acs_map[cast(ubyte)'o']; }
314 @property auto ACS_S9()()
315 {   return acs_map[cast(ubyte)'s']; }
316 @property auto ACS_DIAMOND()()
317 {   return acs_map[cast(ubyte)'`']; }
318 @property auto ACS_CKBOARD()()
319 {   return acs_map[cast(ubyte)'a']; }
320 @property auto ACS_DEGREE()()
321 {   return acs_map[cast(ubyte)'f']; }
322 @property auto ACS_PLMINUS()()
323 {   return acs_map[cast(ubyte)'g']; }
324 @property auto ACS_BULLET()()
325 {   return acs_map[cast(ubyte)'~']; }
326 
327 /* Teletype 5410v1 symbols begin here */
328 @property auto ACS_LARROW()()
329 {   return acs_map[cast(ubyte)',']; }
330 @property auto ACS_RARROW()()
331 {   return  acs_map[cast(ubyte)'+'];}
332 @property auto ACS_DARROW()()
333 {   return acs_map[cast(ubyte)'.']; }
334 @property auto ACS_UARROW()()
335 {   return acs_map[cast(ubyte)'-']; }
336 @property auto ACS_BOARD()()
337 {   return acs_map[cast(ubyte)'h']; }
338 @property auto ACS_LANTERN()()
339 {   return acs_map[cast(ubyte)'i']; }
340 @property auto ACS_BLOCK()()
341 {   return acs_map[cast(ubyte)'0']; }
342 
343 /*
344  * These aren't documented, but a lot of System Vs have them anyway
345  * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
346  * The ACS_names may not match AT&T's, our source didn't know them.
347  */
348 @property auto ACS_S3()()
349 {   return acs_map[cast(ubyte)'p']; }
350 @property auto ACS_S7()()
351 {   return acs_map[cast(ubyte)'r']; }
352 @property auto ACS_LEQUAL()()
353 {   return acs_map[cast(ubyte)'y']; }
354 @property auto ACS_GEQUAL()()
355 {   return acs_map[cast(ubyte)'z']; }
356 @property auto ACS_PI()()
357 {   return acs_map[cast(ubyte)'{']; }
358 @property auto ACS_NEQUAL()()
359 {   return acs_map[cast(ubyte)'|']; }
360 @property auto ACS_STERLING()()
361 {   return acs_map[cast(ubyte)'}']; }
362 
363 /*
364  * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
365  * is the right, b is the bottom, and l is the left.  t, r, b, and l might
366  * be B (blank), S (single), D (double), or T (thick).  The subset defined
367  * here only uses B and S.
368  */
369 @property auto ACS_BSSB()()
370 {   return ACS_ULCORNER();  }
371 @property auto ACS_SSBB()()
372 {   return ACS_LLCORNER();  }
373 @property auto ACS_BBSS()()
374 {   return ACS_URCORNER();  }
375 @property auto ACS_SBBS()()
376 {   return ACS_LRCORNER();  }
377 @property auto ACS_SBSS()()
378 {   return ACS_RTEE();      }
379 @property auto ACS_SSSB()()
380 {   return ACS_LTEE();      }
381 @property auto ACS_SSBS()()
382 {   return ACS_BTEE();      }
383 @property auto ACS_BSSS()()
384 {   return ACS_TTEE();      }
385 @property auto ACS_BSBS()()
386 {   return ACS_HLINE();     }
387 @property auto ACS_SBSB()()
388 {   return ACS_VLINE();     }
389 @property auto ACS_SSSS()()
390 { return ACS_PLUS(); }
391 
392 
393 /** error codes */
394 enum {
395 	ERR = -1, /** error */
396 	OK = 0, /** ok */
397 }
398 
399 
400 /** values for the _flags member */
401 enum {
402 	_SUBWIN = 0x01, /** is this a sub-window? */
403 	_ENDLINE = 0x02, /** is the window flush right? */
404 	_FULLWIN = 0x04, /** is the window full-screen? */
405 	_SCROLLWIN = 0x08, /** bottom edge is at screen bottom? */
406 	_ISPAD = 0x10, /** is this window a pad? */
407 	_HASMOVED = 0x20, /** has cursor moved since last refresh? */
408 	_WRAPPED = 0x40, /** cursor was just wrappped */
409 }
410 
411 
412 /**
413  * this value is used in the firstchar and lastchar fields to mark
414  * unchanged lines
415  */
416 enum _NOCHANGE = -1;
417 
418 
419 /**
420  * this value is used in the oldindex field to mark lines created by insertions
421  * and scrolls.
422  */
423 enum _NEWINDEX = -1;
424 
425 struct screen;
426 alias SCREEN = screen;
427 alias WINDOW = _win_st;
428 
429 alias attr_t = uint; /* ...must be at least as wide as chtype */
430 
431 /* libutf8.h defines it w/o undefining first */
432 
433 /* ...to get mbstate_t, etc. */
434 
435 /*
436  * cchar_t stores an array of CCHARW_MAX wide characters.  The first is
437  * normally a spacing character.  The others are non-spacing.  If those
438  * (spacing and nonspacing) do not fill the array, a null L'\0' follows.
439  * Otherwise, a null is assumed to follow when extracting via getcchar().
440  */
441 
442 /* color pair, must be more than 16-bits */
443 
444 /* NCURSES_WIDECHAR */
445 
446 struct ldat;
447 
448 struct _win_st
449 {
450 	short _cury;
451 	short _curx; /* current cursor position */
452 
453 	/* window location and size */
454 	short _maxy;
455 	short _maxx; /* maximums of x and y, NOT window size */
456 	short _begy;
457 	short _begx; /* screen coords of upper-left-hand corner */
458 
459 	short _flags; /* window state flags */
460 
461 	/* attribute tracking */
462 	attr_t _attrs; /* current attribute for non-space character */
463 	chtype _bkgd; /* current background char/attribute pair */
464 
465 	/* option values set by user */
466 	bool _notimeout; /* no time out on function-key entry? */
467 	bool _clear; /* consider all data in the window invalid? */
468 	bool _leaveok; /* OK to not reset cursor on exit? */
469 	bool _scroll; /* OK to scroll this window? */
470 	bool _idlok; /* OK to use insert/delete line? */
471 	bool _idcok; /* OK to use insert/delete char? */
472 	bool _immed; /* window in immed mode? (not yet used) */
473 	bool _sync; /* window in sync mode? */
474 	bool _use_keypad; /* process function keys into KEY_ symbols? */
475 	int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */
476 
477 	ldat* _line; /* the actual line data */
478 
479 	/* global screen state */
480 	short _regtop; /* top line of scrolling region */
481 	short _regbottom; /* bottom line of scrolling region */
482 
483 	/* these are used only if this is a sub-window */
484 	int _parx; /* x coordinate of this window in parent */
485 	int _pary; /* y coordinate of this window in parent */
486 	WINDOW* _parent; /* pointer to parent if a sub-window */
487 
488 	/* these are used only if this is a pad */
489 	struct pdat
490 	{
491 		short _pad_y;
492 		short _pad_x;
493 		short _pad_top;
494 		short _pad_left;
495 		short _pad_bottom;
496 		short _pad_right;
497 	}
498 
499 	pdat _pad;
500 
501 	short _yoffset; /* real begy is _begy + _yoffset */
502 
503 	/* current background char/attribute pair */
504 
505 	/* current color-pair for non-space character */
506 }
507 
508 /*
509  * Curses uses a helper function.  Define our type for this to simplify
510  * extending it for the sp-funcs feature.
511  */
512 alias NCURSES_OUTC = int function (int);
513 
514 enum NCURSES_EXT_FUNCS = 20180127;
515 alias NCURSES_WINDOW_CB = int function (WINDOW*, void*);
516 alias NCURSES_SCREEN_CB = int function (SCREEN*, void*);
517 
518 /*
519  * Extra extension-functions, which pass a SCREEN pointer rather than using
520  * a global variable SP.
521  */
522 
523 enum NCURSES_SP_FUNCS = 20180127;
524 
525 
526 alias NCURSES_OUTC_sp = int function (SCREEN*, int);
527 
528 /* attributes */
529 
530 enum NCURSES_ATTR_SHIFT = 8;
531 
532 extern (D) auto NCURSES_BITS(T0, T1)(auto ref T0 mask, auto ref T1 shift)
533 {
534 	return NCURSES_CAST!chtype(mask) << (shift + NCURSES_ATTR_SHIFT);
535 }
536 
537 enum A_NORMAL = 1U - 1U;
538 enum A_ATTRIBUTES = NCURSES_BITS(~(1U - 1U), 0);
539 enum A_CHARTEXT = NCURSES_BITS(1U, 0) - 1U;
540 enum A_COLOR = NCURSES_BITS(((1U) << 8) - 1U, 0);
541 enum A_STANDOUT = NCURSES_BITS(1U, 8);
542 enum A_UNDERLINE = NCURSES_BITS(1U, 9);
543 enum A_REVERSE = NCURSES_BITS(1U, 10);
544 enum A_BLINK = NCURSES_BITS(1U, 11);
545 enum A_DIM = NCURSES_BITS(1U, 12);
546 enum A_BOLD = NCURSES_BITS(1U, 13);
547 enum A_ALTCHARSET = NCURSES_BITS(1U, 14);
548 enum A_INVIS = NCURSES_BITS(1U, 15);
549 enum A_PROTECT = NCURSES_BITS(1U, 16);
550 enum A_HORIZONTAL = NCURSES_BITS(1U, 17);
551 enum A_LEFT = NCURSES_BITS(1U, 18);
552 enum A_LOW = NCURSES_BITS(1U, 19);
553 enum A_RIGHT = NCURSES_BITS(1U, 20);
554 enum A_TOP = NCURSES_BITS(1U, 21);
555 enum A_VERTICAL = NCURSES_BITS(1U, 22);
556 
557 enum A_ITALIC = NCURSES_BITS(1U, 23); /* ncurses extension */
558 
559 /* It seems older SYSV curses versions define these */
560 extern (D) auto getcurx(T)(auto ref T win)
561 {
562 	return NCURSES_OK_ADDR(win) ? win._curx : ERR;
563 }
564 
565 extern (D) auto getcury(T)(auto ref T win)
566 {
567 	return NCURSES_OK_ADDR(win) ? win._cury : ERR;
568 }
569 
570 extern (D) auto getbegx(T)(auto ref T win)
571 {
572 	return NCURSES_OK_ADDR(win) ? win._begx : ERR;
573 }
574 
575 extern (D) auto getbegy(T)(auto ref T win)
576 {
577 	return NCURSES_OK_ADDR(win) ? win._begy : ERR;
578 }
579 
580 extern (D) auto getmaxx(T)(auto ref T win)
581 {
582 	return NCURSES_OK_ADDR(win) ? (win._maxx + 1) : ERR;
583 }
584 
585 extern (D) auto getmaxy(T)(auto ref T win)
586 {
587 	return NCURSES_OK_ADDR(win) ? (win._maxy + 1) : ERR;
588 }
589 
590 extern (D) auto getparx(T)(auto ref T win)
591 {
592 	return NCURSES_OK_ADDR(win) ? win._parx : ERR;
593 }
594 
595 extern (D) auto getpary(T)(auto ref T win)
596 {
597 	return NCURSES_OK_ADDR(win) ? win._pary : ERR;
598 }
599 
600 /*
601  * These apply to the first 256 color pairs.
602  */
603 extern (D) auto COLOR_PAIR(T)(auto ref T n)
604 {
605 	return NCURSES_BITS(n, 0) & A_COLOR;
606 }
607 
608 extern (D) auto PAIR_NUMBER(T)(auto ref T a)
609 {
610 	return NCURSES_CAST!int((NCURSES_CAST!c_ulong(a) & A_COLOR) >> NCURSES_ATTR_SHIFT);
611 }
612 
613 /*
614  * Some wide-character functions can be implemented without the extensions.
615  */
616 extern (D) auto getbkgd(T)(auto ref T win)
617 {
618 	return NCURSES_OK_ADDR(win) ? (win._bkgd) : 0;
619 }
620 
621 /* !(NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
622 /* (NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
623 /* NCURSES_WATTR_MACROS */
624 /* NCURSES_OPAQUE */
625 
626 /*
627  * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
628  * varargs.h.  It adds new calls vw_printw/vw_scanw, which are supposed to
629  * use POSIX stdarg.h.  The ncurses versions of vwprintw/vwscanw already
630  * use stdarg.h, so...
631  */
632 
633 /*
634  * Export fallback function for use in C++ binding.
635  */
636 
637 /*
638  * These macros are extensions - not in X/Open Curses.
639  */
640 
641 extern (D) auto is_cleared(T)(auto ref T win)
642 {
643 	return NCURSES_OK_ADDR(win) ? win._clear : FALSE;
644 }
645 
646 extern (D) auto is_idcok(T)(auto ref T win)
647 {
648 	return NCURSES_OK_ADDR(win) ? win._idcok : FALSE;
649 }
650 
651 extern (D) auto is_idlok(T)(auto ref T win)
652 {
653 	return NCURSES_OK_ADDR(win) ? win._idlok : FALSE;
654 }
655 
656 extern (D) auto is_immedok(T)(auto ref T win)
657 {
658 	return NCURSES_OK_ADDR(win) ? win._immed : FALSE;
659 }
660 
661 extern (D) auto is_keypad(T)(auto ref T win)
662 {
663 	return NCURSES_OK_ADDR(win) ? win._use_keypad : FALSE;
664 }
665 
666 extern (D) auto is_leaveok(T)(auto ref T win)
667 {
668 	return NCURSES_OK_ADDR(win) ? win._leaveok : FALSE;
669 }
670 
671 extern (D) auto is_nodelay(T)(auto ref T win)
672 {
673 	return NCURSES_OK_ADDR(win) ? (win._delay == 0) : FALSE;
674 }
675 
676 extern (D) auto is_notimeout(T)(auto ref T win)
677 {
678 	return NCURSES_OK_ADDR(win) ? win._notimeout : FALSE;
679 }
680 
681 extern (D) auto is_pad(T)(auto ref T win)
682 {
683 	return NCURSES_OK_ADDR(win) ? (win._flags & _ISPAD) != 0 : FALSE;
684 }
685 
686 extern (D) auto is_scrollok(T)(auto ref T win)
687 {
688 	return NCURSES_OK_ADDR(win) ? win._scroll : FALSE;
689 }
690 
691 extern (D) auto is_subwin(T)(auto ref T win)
692 {
693 	return NCURSES_OK_ADDR(win) ? (win._flags & _SUBWIN) != 0 : FALSE;
694 }
695 
696 extern (D) auto is_syncok(T)(auto ref T win)
697 {
698 	return NCURSES_OK_ADDR(win) ? win._sync : FALSE;
699 }
700 
701 extern (D) auto wgetdelay(T)(auto ref T win)
702 {
703 	return NCURSES_OK_ADDR(win) ? win._delay : 0;
704 }
705 
706 extern (D) auto wgetparent(T)(auto ref T win)
707 {
708 	return NCURSES_OK_ADDR(win) ? win._parent : 0;
709 }
710 
711 /*
712  * Pseudo-character tokens outside ASCII range.  The curses wgetch() function
713  * will return any given one of these only if the corresponding k- capability
714  * is defined in your terminal's terminfo entry.
715  *
716  * Some keys (KEY_A1, etc) are arranged like this:
717  *	a1     up    a3
718  *	left   b2    right
719  *	c1     down  c3
720  *
721  * A few key codes do not depend upon the terminfo entry.
722  */
723 enum KEY_CODE_YES = octal!int("400"); /* A wchar_t contains a key code */
724 enum KEY_MIN = octal!int("401"); /* Minimum curses key */
725 enum KEY_BREAK = octal!int("401"); /* Break key (unreliable) */
726 enum KEY_SRESET = octal!int("530"); /* Soft (partial) reset (unreliable) */
727 enum KEY_RESET = octal!int("531"); /* Reset or hard reset (unreliable) */
728 /*
729  * These definitions were generated by ./MKkey_defs.sh ./Caps
730  */
731 enum KEY_DOWN = octal!int("402"); /* down-arrow key */
732 enum KEY_UP = octal!int("403"); /* up-arrow key */
733 enum KEY_LEFT = octal!int("404"); /* left-arrow key */
734 enum KEY_RIGHT = octal!int("405"); /* right-arrow key */
735 enum KEY_HOME = octal!int("406"); /* home key */
736 enum KEY_BACKSPACE = octal!int("407"); /* backspace key */
737 enum KEY_F0 = octal!int("410"); /* Function keys.  Space for 64 */
738 extern (D) int KEY_F(N:int)(N n)
739 in
740 {
741 	assert (n>=0, "Invalid value for KEY_F(n)");
742 	assert (n<=63, "Invalid value for KEY_F(n)");
743 }
744 out (result)
745 {
746 	assert (result < KEY_DL, "Invalid value for KEY_F(n)");
747 }
748 body
749 {
750 	return KEY_F0 + n;
751 } /* Value of function key n */
752 enum KEY_DL = octal!int("510"); /* delete-line key */
753 enum KEY_IL = octal!int("511"); /* insert-line key */
754 enum KEY_DC = octal!int("512"); /* delete-character key */
755 enum KEY_IC = octal!int("513"); /* insert-character key */
756 enum KEY_EIC = octal!int("514"); /* sent by rmir or smir in insert mode */
757 enum KEY_CLEAR = octal!int("515"); /* clear-screen or erase key */
758 enum KEY_EOS = octal!int("516"); /* clear-to-end-of-screen key */
759 enum KEY_EOL = octal!int("517"); /* clear-to-end-of-line key */
760 enum KEY_SF = octal!int("520"); /* scroll-forward key */
761 enum KEY_SR = octal!int("521"); /* scroll-backward key */
762 enum KEY_NPAGE = octal!int("522"); /* next-page key */
763 enum KEY_PPAGE = octal!int("523"); /* previous-page key */
764 enum KEY_STAB = octal!int("524"); /* set-tab key */
765 enum KEY_CTAB = octal!int("525"); /* clear-tab key */
766 enum KEY_CATAB = octal!int("526"); /* clear-all-tabs key */
767 enum KEY_ENTER = octal!int("527"); /* enter/send key */
768 enum KEY_PRINT = octal!int("532"); /* print key */
769 enum KEY_LL = octal!int("533"); /* lower-left key (home down) */
770 enum KEY_A1 = octal!int("534"); /* upper left of keypad */
771 enum KEY_A3 = octal!int("535"); /* upper right of keypad */
772 enum KEY_B2 = octal!int("536"); /* center of keypad */
773 enum KEY_C1 = octal!int("537"); /* lower left of keypad */
774 enum KEY_C3 = octal!int("540"); /* lower right of keypad */
775 enum KEY_BTAB = octal!int("541"); /* back-tab key */
776 enum KEY_BEG = octal!int("542"); /* begin key */
777 enum KEY_CANCEL = octal!int("543"); /* cancel key */
778 enum KEY_CLOSE = octal!int("544"); /* close key */
779 enum KEY_COMMAND = octal!int("545"); /* command key */
780 enum KEY_COPY = octal!int("546"); /* copy key */
781 enum KEY_CREATE = octal!int("547"); /* create key */
782 enum KEY_END = octal!int("550"); /* end key */
783 enum KEY_EXIT = octal!int("551"); /* exit key */
784 enum KEY_FIND = octal!int("552"); /* find key */
785 enum KEY_HELP = octal!int("553"); /* help key */
786 enum KEY_MARK = octal!int("554"); /* mark key */
787 enum KEY_MESSAGE = octal!int("555"); /* message key */
788 enum KEY_MOVE = octal!int("556"); /* move key */
789 enum KEY_NEXT = octal!int("557"); /* next key */
790 enum KEY_OPEN = octal!int("560"); /* open key */
791 enum KEY_OPTIONS = octal!int("561"); /* options key */
792 enum KEY_PREVIOUS = octal!int("562"); /* previous key */
793 enum KEY_REDO = octal!int("563"); /* redo key */
794 enum KEY_REFERENCE = octal!int("564"); /* reference key */
795 enum KEY_REFRESH = octal!int("565"); /* refresh key */
796 enum KEY_REPLACE = octal!int("566"); /* replace key */
797 enum KEY_RESTART = octal!int("567"); /* restart key */
798 enum KEY_RESUME = octal!int("570"); /* resume key */
799 enum KEY_SAVE = octal!int("571"); /* save key */
800 enum KEY_SBEG = octal!int("572"); /* shifted begin key */
801 enum KEY_SCANCEL = octal!int("573"); /* shifted cancel key */
802 enum KEY_SCOMMAND = octal!int("574"); /* shifted command key */
803 enum KEY_SCOPY = octal!int("575"); /* shifted copy key */
804 enum KEY_SCREATE = octal!int("576"); /* shifted create key */
805 enum KEY_SDC = octal!int("577"); /* shifted delete-character key */
806 enum KEY_SDL = octal!int("600"); /* shifted delete-line key */
807 enum KEY_SELECT = octal!int("601"); /* select key */
808 enum KEY_SEND = octal!int("602"); /* shifted end key */
809 enum KEY_SEOL = octal!int("603"); /* shifted clear-to-end-of-line key */
810 enum KEY_SEXIT = octal!int("604"); /* shifted exit key */
811 enum KEY_SFIND = octal!int("605"); /* shifted find key */
812 enum KEY_SHELP = octal!int("606"); /* shifted help key */
813 enum KEY_SHOME = octal!int("607"); /* shifted home key */
814 enum KEY_SIC = octal!int("610"); /* shifted insert-character key */
815 enum KEY_SLEFT = octal!int("611"); /* shifted left-arrow key */
816 enum KEY_SMESSAGE = octal!int("612"); /* shifted message key */
817 enum KEY_SMOVE = octal!int("613"); /* shifted move key */
818 enum KEY_SNEXT = octal!int("614"); /* shifted next key */
819 enum KEY_SOPTIONS = octal!int("615"); /* shifted options key */
820 enum KEY_SPREVIOUS = octal!int("616"); /* shifted previous key */
821 enum KEY_SPRINT = octal!int("617"); /* shifted print key */
822 enum KEY_SREDO = octal!int("620"); /* shifted redo key */
823 enum KEY_SREPLACE = octal!int("621"); /* shifted replace key */
824 enum KEY_SRIGHT = octal!int("622"); /* shifted right-arrow key */
825 enum KEY_SRSUME = octal!int("623"); /* shifted resume key */
826 enum KEY_SSAVE = octal!int("624"); /* shifted save key */
827 enum KEY_SSUSPEND = octal!int("625"); /* shifted suspend key */
828 enum KEY_SUNDO = octal!int("626"); /* shifted undo key */
829 enum KEY_SUSPEND = octal!int("627"); /* suspend key */
830 enum KEY_UNDO = octal!int("630"); /* undo key */
831 enum KEY_MOUSE = octal!int("631"); /* Mouse event has occurred */
832 enum KEY_RESIZE = octal!int("632"); /* Terminal resize event */
833 enum KEY_EVENT = octal!int("633"); /* We were interrupted by an event */
834 
835 enum KEY_MAX = octal!int("777"); /* Maximum key value is 0633 */
836 /* $Id: curses.wide,v 1.50 2017/03/26 16:05:21 tom Exp $ */
837 /*
838  * vile:cmode:
839  * This file is part of ncurses, designed to be appended after curses.h.in
840  * (see that file for the relevant copyright).
841  */
842 enum _XOPEN_CURSES = 1;
843 
844 /* mouse interface */
845 
846 extern (D) auto NCURSES_MOUSE_MASK(T0, T1)(auto ref T0 b, auto ref T1 m)
847 {
848 	return m << ((b - 1) * 5);
849 }
850 
851 /* macros to extract single event-bits from masks */
852 extern (D) auto BUTTON_RELEASE(T0, T1)(auto ref T0 e, auto ref T1 x)
853 {
854 	return e & NCURSES_MOUSE_MASK(x, octal!int("1"));
855 }
856 
857 extern (D) auto BUTTON_PRESS(T0, T1)(auto ref T0 e, auto ref T1 x)
858 {
859 	return e & NCURSES_MOUSE_MASK(x, octal!int("2"));
860 }
861 
862 extern (D) auto BUTTON_CLICK(T0, T1)(auto ref T0 e, auto ref T1 x)
863 {
864 	return e & NCURSES_MOUSE_MASK(x, octal!int("4"));
865 }
866 
867 extern (D) auto BUTTON_DOUBLE_CLICK(T0, T1)(auto ref T0 e, auto ref T1 x)
868 {
869 	return e & NCURSES_MOUSE_MASK(x, octal!int("10"));
870 }
871 
872 extern (D) auto BUTTON_TRIPLE_CLICK(T0, T1)(auto ref T0 e, auto ref T1 x)
873 {
874 	return e & NCURSES_MOUSE_MASK(x, octal!int("20"));
875 }
876 
877 extern (D) auto BUTTON_RESERVED_EVENT(T0, T1)(auto ref T0 e, auto ref T1 x)
878 {
879 	return e & NCURSES_MOUSE_MASK(x, octal!int("40"));
880 }
881 
882 enum NCURSES_BUTTON_RELEASED = octal!int("1L");
883 enum NCURSES_BUTTON_PRESSED = octal!int("2L");
884 enum NCURSES_BUTTON_CLICKED = octal!int("4L");
885 enum NCURSES_DOUBLE_CLICKED = octal!int("10L");
886 enum NCURSES_TRIPLE_CLICKED = octal!int("20L");
887 enum NCURSES_RESERVED_EVENT = octal!int("40L");
888 
889 /* event masks */
890 enum BUTTON1_RELEASED = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED);
891 enum BUTTON1_PRESSED = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED);
892 enum BUTTON1_CLICKED = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED);
893 enum BUTTON1_DOUBLE_CLICKED = NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED);
894 enum BUTTON1_TRIPLE_CLICKED = NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED);
895 
896 enum BUTTON2_RELEASED = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED);
897 enum BUTTON2_PRESSED = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED);
898 enum BUTTON2_CLICKED = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED);
899 enum BUTTON2_DOUBLE_CLICKED = NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED);
900 enum BUTTON2_TRIPLE_CLICKED = NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED);
901 
902 enum BUTTON3_RELEASED = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED);
903 enum BUTTON3_PRESSED = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED);
904 enum BUTTON3_CLICKED = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED);
905 enum BUTTON3_DOUBLE_CLICKED = NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED);
906 enum BUTTON3_TRIPLE_CLICKED = NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED);
907 
908 enum BUTTON4_RELEASED = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED);
909 enum BUTTON4_PRESSED = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED);
910 enum BUTTON4_CLICKED = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED);
911 enum BUTTON4_DOUBLE_CLICKED = NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED);
912 enum BUTTON4_TRIPLE_CLICKED = NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED);
913 
914 /*
915  * In 32 bits the version-1 scheme does not provide enough space for a 5th
916  * button, unless we choose to change the ABI by omitting the reserved-events.
917  */
918 
919 enum BUTTON5_RELEASED = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED);
920 enum BUTTON5_PRESSED = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED);
921 enum BUTTON5_CLICKED = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED);
922 enum BUTTON5_DOUBLE_CLICKED = NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED);
923 enum BUTTON5_TRIPLE_CLICKED = NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED);
924 
925 enum BUTTON_CTRL = NCURSES_MOUSE_MASK(6, octal!int("1L"));
926 enum BUTTON_SHIFT = NCURSES_MOUSE_MASK(6, octal!int("2L"));
927 enum BUTTON_ALT = NCURSES_MOUSE_MASK(6, octal!int("4L"));
928 enum REPORT_MOUSE_POSITION = NCURSES_MOUSE_MASK(6, octal!int("10L"));
929 
930 enum ALL_MOUSE_EVENTS = REPORT_MOUSE_POSITION - 1;
931 
932 struct MEVENT
933 {
934 	short id; /* ID to distinguish multiple devices */
935 	int x;
936 	int y;
937 	int z; /* event coordinates (character-cell) */
938 	mmask_t bstate; /* button state bits */
939 }
940 
941 /** trace masks */
942 enum {
943 	TRACE_DISABLE = 0x0000, /** turn off tracing */
944 	TRACE_TIMES = 0x0001, /** trace user and system times of updates */
945 	TRACE_TPUTS = 0x0002, /** trace tputs calls */
946 	TRACE_UPDATE = 0x0004, /** trace update actions, old & new screens */
947 	TRACE_MOVE = 0x0008, /** trace cursor moves and scrolls */
948 	TRACE_CHARPUT = 0x0010, /** trace all character outputs */
949 	TRACE_ORDINARY = 0x001F, /** trace all update actions */
950 	TRACE_CALLS = 0x0020, /** trace all curses calls */
951 	TRACE_VIRTPUT = 0x0040, /** trace virtual character puts */
952 	TRACE_IEVENT = 0x0080, /** trace low-level input processing */
953 	TRACE_BITS = 0x0100, /** trace state of TTY control bits */
954 	TRACE_ICALLS = 0x0200, /** trace internal/nested calls */
955 	TRACE_CCALLS = 0x0400, /** trace per-character calls */
956 	TRACE_DATABASE = 0x0800, /** trace read/write of terminfo/termcap data */
957 	TRACE_ATTRS = 0x1000, /** trace attribute updates */
958 
959 	TRACE_SHIFT = 13, /** number of bits in the trace masks */
960 	TRACE_MAXIMUM = (1 << TRACE_SHIFT) - 1, /** maximum trace level */
961 }
962 
963 
964 extern(C) @nogc nothrow {
965 	alias da_initscr = WINDOW* function();
966 	alias da_longname = char* function();
967 	alias da_newpad = WINDOW* function(int, int);
968 	alias da_newterm = SCREEN* function(const(char)*, FILE*, FILE*);
969 	alias da_newwin = WINDOW* function(int, int, int, int);
970 	alias da_set_term = SCREEN* function(SCREEN*);
971 	alias da_slk_label = char* function(int);
972 	alias da_subpad = WINDOW* function(WINDOW*, int, int, int, int);
973 	alias da_subwin = WINDOW* function(WINDOW*, int, int, int, int);
974 	alias da_termname = char* function();
975 	alias da_tigetstr = char* function(const(char)*);
976 	alias da_tparm = char* function(const(char)*, ...);
977 	alias da_tiparm = char* function(const(char)*, ...);
978 	alias da_keybound = char* function(int, int);
979 	alias da_wgetparent = WINDOW* function(const(WINDOW)*);
980 	alias da_new_prescr = SCREEN* function();
981 	alias da_getwin_sp = WINDOW* function(SCREEN*, FILE*);
982 	alias da_longname_sp = char* function(SCREEN*);
983 	alias da_newpad_sp = WINDOW* function(SCREEN*, int, int);
984 	alias da_newterm_sp = SCREEN* function(SCREEN*, const(char)*, FILE*, FILE*);
985 	alias da_newwin_sp = WINDOW* function(SCREEN*, int, int, int, int);
986 	alias da_getwin = WINDOW* function(FILE*);
987 	alias da_derwin = WINDOW* function(WINDOW*, int, int, int, int);
988 	alias da_dupwin = WINDOW* function(WINDOW*);
989 	alias da_termname_sp = char* function(SCREEN*);
990 	alias da_slk_label_sp = char* function(SCREEN*, int);
991 	alias da_curses_version = const(char)* function();
992 	alias da_keyname_sp = const(char)* function(SCREEN*, int);
993 	alias da_keyname = const(char)* function(int);
994 	alias da_addch = int function(const chtype);
995 	alias da_addchnstr = int function(const(chtype)*, int);
996 	alias da_addchstr = int function(const(chtype)*);
997 	alias da_addnstr = int function(const(char)*, int);
998 	alias da_addstr = int function(const(char)*);
999 	alias da_attroff = int function(int);
1000 	alias da_attron = int function(int);
1001 	alias da_attrset = int function(int);
1002 	alias da_attr_get = int function(attr_t*, short*, void*);
1003 	alias da_attr_off = int function(attr_t, void*);
1004 	alias da_attr_on = int function(attr_t, void*);
1005 	alias da_attr_set = int function(attr_t, short, void*);
1006 	alias da_baudrate = int function();
1007 	alias da_beep = int function();
1008 	alias da_bkgd = int function(chtype);
1009 	alias da_bkgdset = void function(chtype);
1010 	alias da_box = int function(WINDOW*, chtype, chtype);
1011 	alias da_can_change_color = bool function();
1012 	alias da_cbreak = int function();
1013 	alias da_chgat = int function(int, attr_t, short, const(void)*);
1014 	alias da_clear = int function();
1015 	alias da_clearok = int function(WINDOW*, bool);
1016 	alias da_clrtobot = int function();
1017 	alias da_clrtoeol = int function();
1018 	alias da_color_content = int function(short, short*, short*, short*);
1019 	alias da_color_set = int function(short, void*);
1020 	alias da_copywin = int function(const(WINDOW)*, WINDOW*, int, int, int, int, int, int, int);
1021 	alias da_curs_set = int function(int);
1022 	alias da_def_prog_mode = int function();
1023 	alias da_def_shell_mode = int function();
1024 	alias da_delay_output = int function(int);
1025 	alias da_delch = int function();
1026 	alias da_delscreen = void function(SCREEN*);
1027 	alias da_delwin = int function(WINDOW*);
1028 	alias da_deleteln = int function();
1029 	alias da_doupdate = int function();
1030 	alias da_echo = int function();
1031 	alias da_echochar = int function(const chtype);
1032 	alias da_erase = int function();
1033 	alias da_endwin = int function();
1034 	alias da_erasechar = char function();
1035 	alias da_filter = void function();
1036 	alias da_flash = int function();
1037 	alias da_flushinp = int function();
1038 	alias da_getbkgd = chtype function(WINDOW*);
1039 	alias da_getch = int function();
1040 	alias da_getnstr = int function(char*, int);
1041 	alias da_getstr = int function(char*);
1042 	alias da_halfdelay = int function(int);
1043 	alias da_has_colors = bool function();
1044 	alias da_has_ic = bool function();
1045 	alias da_has_il = bool function();
1046 	alias da_hline = int function(chtype, int);
1047 	alias da_idcok = void function(WINDOW*, bool);
1048 	alias da_idlok = int function(WINDOW*, bool);
1049 	alias da_immedok = void function(WINDOW*, bool);
1050 	alias da_inch = chtype function();
1051 	alias da_inchnstr = int function(chtype*, int);
1052 	alias da_inchstr = int function(chtype*);
1053 	alias da_init_color = int function(short, short, short, short);
1054 	alias da_init_pair = int function(short, short, short);
1055 	alias da_innstr = int function(char*, int);
1056 	alias da_insch = int function(chtype);
1057 	alias da_insdelln = int function(int);
1058 	alias da_insertln = int function();
1059 	alias da_insnstr = int function(const(char)*, int);
1060 	alias da_insstr = int function(const(char)*);
1061 	alias da_instr = int function(char*);
1062 	alias da_intrflush = int function(WINDOW*, bool);
1063 	alias da_isendwin = bool function();
1064 	alias da_is_linetouched = bool function(WINDOW*, int);
1065 	alias da_is_wintouched = bool function(WINDOW*);
1066 	alias da_keypad = int function(WINDOW*, bool);
1067 	alias da_killchar = char function();
1068 	alias da_leaveok = int function(WINDOW*, bool);
1069 	alias da_meta = int function(WINDOW*, bool);
1070 	alias da_move = int function(int, int);
1071 	alias da_mvaddch = int function(int, int, const chtype);
1072 	alias da_mvaddchnstr = int function(int, int, const(chtype)*, int);
1073 	alias da_mvaddchstr = int function(int, int, const(chtype)*);
1074 	alias da_mvaddnstr = int function(int, int, const(char)*, int);
1075 	alias da_mvaddstr = int function(int, int, const(char)*);
1076 	alias da_mvchgat = int function(int, int, int, attr_t, short, const(void)*);
1077 	alias da_mvcur = int function(int, int, int, int);
1078 	alias da_mvdelch = int function(int, int);
1079 	alias da_mvderwin = int function(WINDOW*, int, int);
1080 	alias da_mvgetch = int function(int, int);
1081 	alias da_mvgetnstr = int function(int, int, char*, int);
1082 	alias da_mvgetstr = int function(int, int, char*);
1083 	alias da_mvhline = int function(int, int, chtype, int);
1084 	alias da_mvinch = chtype function(int, int);
1085 	alias da_mvinchnstr = int function(int, int, chtype*, int);
1086 	alias da_mvinchstr = int function(int, int, chtype*);
1087 	alias da_mvinnstr = int function(int, int, char*, int);
1088 	alias da_mvinsch = int function(int, int, chtype);
1089 	alias da_mvinsnstr = int function(int, int, const(char)*, int);
1090 	alias da_mvinsstr = int function(int, int, const(char)*);
1091 	alias da_mvinstr = int function(int, int, char*);
1092 	alias da_mvprintw = int function(int, int, const(char)*, ...);
1093 	alias da_mvscanw = int function(int, int, const(char)*, ...);
1094 	alias da_mvvline = int function(int, int, chtype, int);
1095 	alias da_mvwaddch = int function(WINDOW*, int, int, const chtype);
1096 	alias da_mvwaddchnstr = int function(WINDOW*, int, int, const(chtype)*, int);
1097 	alias da_mvwaddchstr = int function(WINDOW*, int, int, const(chtype)*);
1098 	alias da_mvwaddnstr = int function(WINDOW*, int, int, const(char)*, int);
1099 	alias da_mvwaddstr = int function(WINDOW*, int, int, const(char)*);
1100 	alias da_mvwchgat = int function(WINDOW*, int, int, int, attr_t, short, const(void)*);
1101 	alias da_mvwdelch = int function(WINDOW*, int, int);
1102 	alias da_mvwgetch = int function(WINDOW*, int, int);
1103 	alias da_mvwgetnstr = int function(WINDOW*, int, int, char*, int);
1104 	alias da_mvwgetstr = int function(WINDOW*, int, int, char*);
1105 	alias da_mvwhline = int function(WINDOW*, int, int, chtype, int);
1106 	alias da_mvwin = int function(WINDOW*, int, int);
1107 	alias da_mvwinch = chtype function(WINDOW*, int, int);
1108 	alias da_mvwinchnstr = int function(WINDOW*, int, int, chtype*, int);
1109 	alias da_mvwinchstr = int function(WINDOW*, int, int, chtype*);
1110 	alias da_mvwinnstr = int function(WINDOW*, int, int, char*, int);
1111 	alias da_mvwinsch = int function(WINDOW*, int, int, chtype);
1112 	alias da_mvwinsnstr = int function(WINDOW*, int, int, const(char)*, int);
1113 	alias da_mvwinsstr = int function(WINDOW*, int, int, const(char)*);
1114 	alias da_mvwinstr = int function(WINDOW*, int, int, char*);
1115 	alias da_mvwprintw = int function(WINDOW*, int, int, const(char)*, ...);
1116 	alias da_mvwscanw = int function(WINDOW*, int, int, const(char)*, ...);
1117 	alias da_mvwvline = int function(WINDOW*, int, int, chtype, int);
1118 	alias da_napms = int function(int);
1119 	alias da_nl = int function();
1120 	alias da_nocbreak = int function();
1121 	alias da_nodelay = int function(WINDOW*, bool);
1122 	alias da_noecho = int function();
1123 	alias da_nonl = int function();
1124 	alias da_noqiflush = void function();
1125 	alias da_noraw = int function();
1126 	alias da_notimeout = int function(WINDOW*, bool);
1127 	alias da_overlay = int function(const(WINDOW)*, WINDOW*);
1128 	alias da_overwrite = int function(const(WINDOW)*, WINDOW*);
1129 	alias da_pair_content = int function(short, short*, short*);
1130 	alias da_PAIR_NUMBER = int function(int);
1131 	alias da_pechochar = int function(WINDOW*, const chtype);
1132 	alias da_pnoutrefresh = int function(WINDOW*, int, int, int, int, int, int);
1133 	alias da_prefresh = int function(WINDOW*, int, int, int, int, int, int);
1134 	alias da_printw = int function(const(char)*, ...);
1135 	alias da_putwin = int function(WINDOW*, FILE*);
1136 	alias da_qiflush = void function();
1137 	alias da_raw = int function();
1138 	alias da_redrawwin = int function(WINDOW*);
1139 	alias da_refresh = int function();
1140 	alias da_resetty = int function();
1141 	alias da_reset_prog_mode = int function();
1142 	alias da_reset_shell_mode = int function();
1143 	alias da_ripoffline = int function(int, int function (WINDOW*, int));
1144 	alias da_savetty = int function();
1145 	alias da_scanw = int function(const(char)*, ...);
1146 	alias da_scr_dump = int function(const(char)*);
1147 	alias da_scr_init = int function(const(char)*);
1148 	alias da_scrl = int function(int);
1149 	alias da_scroll = int function(WINDOW*);
1150 	alias da_scrollok = int function(WINDOW*, bool);
1151 	alias da_scr_restore = int function(const(char)*);
1152 	alias da_scr_set = int function(const(char)*);
1153 	alias da_setscrreg = int function(int, int);
1154 	alias da_slk_attroff = int function(const chtype);
1155 	alias da_slk_attr_off = int function(const attr_t, void*);
1156 	alias da_slk_attron = int function(const chtype);
1157 	alias da_slk_attr_on = int function(attr_t, void*);
1158 	alias da_slk_attrset = int function(const chtype);
1159 	alias da_slk_attr = attr_t function();
1160 	alias da_slk_attr_set = int function(const attr_t, short, void*);
1161 	alias da_slk_clear = int function();
1162 	alias da_slk_color = int function(short);
1163 	alias da_slk_init = int function(int);
1164 	alias da_slk_noutrefresh = int function();
1165 	alias da_slk_refresh = int function();
1166 	alias da_slk_restore = int function();
1167 	alias da_slk_set = int function(int, const(char)*, int);
1168 	alias da_slk_touch = int function();
1169 	alias da_standout = int function();
1170 	alias da_standend = int function();
1171 	alias da_start_color = int function();
1172 	alias da_syncok = int function(WINDOW*, bool);
1173 	alias da_termattrs = chtype function();
1174 	alias da_timeout = void function(int);
1175 	alias da_touchline = int function(WINDOW*, int, int);
1176 	alias da_touchwin = int function(WINDOW*);
1177 	alias da_typeahead = int function(int);
1178 	alias da_ungetch = int function(int);
1179 	alias da_untouchwin = int function(WINDOW*);
1180 	alias da_use_env = void function(bool);
1181 	alias da_use_tioctl = void function(bool);
1182 	alias da_vidattr = int function(chtype);
1183 	alias da_vidputs = int function(chtype, NCURSES_OUTC);
1184 	alias da_vline = int function(chtype, int);
1185 	alias da_vwprintw = int function(WINDOW*, const(char)*, va_list);
1186 	alias da_vw_printw = int function(WINDOW*, const(char)*, va_list);
1187 	alias da_vwscanw = int function(WINDOW*, const(char)*, va_list);
1188 	alias da_vw_scanw = int function(WINDOW*, const(char)*, va_list);
1189 	alias da_waddch = int function(WINDOW*, const chtype);
1190 	alias da_waddchnstr = int function(WINDOW*, const(chtype)*, int);
1191 	alias da_waddchstr = int function(WINDOW*, const(chtype)*);
1192 	alias da_waddnstr = int function(WINDOW*, const(char)*, int);
1193 	alias da_wattron = int function(WINDOW*, int);
1194 	alias da_wattroff = int function(WINDOW*, int);
1195 	alias da_wattrset = int function(WINDOW*, int);
1196 	alias da_wattr_get = int function(WINDOW*, attr_t*, short*, void*);
1197 	alias da_wattr_on = int function(WINDOW*, attr_t, void*);
1198 	alias da_wattr_off = int function(WINDOW*, attr_t, void*);
1199 	alias da_wattr_set = int function(WINDOW*, attr_t, short, void*);
1200 	alias da_wbkgd = int function(WINDOW*, chtype);
1201 	alias da_wbkgdset = void function(WINDOW*, chtype);
1202 	alias da_wborder = int function(WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
1203 	alias da_wchgat = int function(WINDOW*, int, attr_t, short, const(void)*);
1204 	alias da_wclear = int function(WINDOW*);
1205 	alias da_wclrtobot = int function(WINDOW*);
1206 	alias da_wclrtoeol = int function(WINDOW*);
1207 	alias da_wcolor_set = int function(WINDOW*, short, void*);
1208 	alias da_wcursyncup = void function(WINDOW*);
1209 	alias da_wdelch = int function(WINDOW*);
1210 	alias da_wdeleteln = int function(WINDOW*);
1211 	alias da_wechochar = int function(WINDOW*, const chtype);
1212 	alias da_werase = int function(WINDOW*);
1213 	alias da_wgetch = int function(WINDOW*);
1214 	alias da_wgetnstr = int function(WINDOW*, char*, int);
1215 	alias da_wgetstr = int function(WINDOW*, char*);
1216 	alias da_whline = int function(WINDOW*, chtype, int);
1217 	alias da_winch = chtype function(WINDOW*);
1218 	alias da_winchnstr = int function(WINDOW*, chtype*, int);
1219 	alias da_winchstr = int function(WINDOW*, chtype*);
1220 	alias da_winnstr = int function(WINDOW*, char*, int);
1221 	alias da_winsch = int function(WINDOW*, chtype);
1222 	alias da_winsdelln = int function(WINDOW*, int);
1223 	alias da_winsertln = int function(WINDOW*);
1224 	alias da_winsnstr = int function(WINDOW*, const(char)*, int);
1225 	alias da_winsstr = int function(WINDOW*, const(char)*);
1226 	alias da_winstr = int function(WINDOW*, char*);
1227 	alias da_wmove = int function(WINDOW*, int, int);
1228 	alias da_wnoutrefresh = int function(WINDOW*);
1229 	alias da_wprintw = int function(WINDOW*, const(char)*, ...);
1230 	alias da_wredrawln = int function(WINDOW*, int, int);
1231 	alias da_wrefresh = int function(WINDOW*);
1232 	alias da_wscanw = int function(WINDOW*, const(char)*, ...);
1233 	alias da_wscrl = int function(WINDOW*, int);
1234 	alias da_wsetscrreg = int function(WINDOW*, int, int);
1235 	alias da_wstandout = int function(WINDOW*);
1236 	alias da_wstandend = int function(WINDOW*);
1237 	alias da_wsyncdown = void function(WINDOW*);
1238 	alias da_wsyncup = void function(WINDOW*);
1239 	alias da_wtimeout = void function(WINDOW*, int);
1240 	alias da_wtouchln = int function(WINDOW*, int, int, int);
1241 	alias da_wvline = int function(WINDOW*, chtype, int);
1242 	alias da_tigetflag = int function(const(char)*);
1243 	alias da_tigetnum = int function(const(char)*);
1244 	alias da_putp = int function(const(char)*);
1245 	alias da_getattrs = int function(const(WINDOW)*);
1246 	alias da_getcurx = int function(const(WINDOW)*);
1247 	alias da_getcury = int function(const(WINDOW)*);
1248 	alias da_getbegx = int function(const(WINDOW)*);
1249 	alias da_getbegy = int function(const(WINDOW)*);
1250 	alias da_getmaxx = int function(const(WINDOW)*);
1251 	alias da_getmaxy = int function(const(WINDOW)*);
1252 	alias da_getparx = int function(const(WINDOW)*);
1253 	alias da_getpary = int function(const(WINDOW)*);
1254 	alias da_is_term_resized = bool function(int, int);
1255 	alias da_alloc_pair = int function(int, int);
1256 	alias da_assume_default_colors = int function(int, int);
1257 	alias da_define_key = int function(const(char)*, int);
1258 	alias da_extended_color_content = int function(int, int*, int*, int*);
1259 	alias da_extended_pair_content = int function(int, int*, int*);
1260 	alias da_extended_slk_color = int function(int);
1261 	alias da_find_pair = int function(int, int);
1262 	alias da_free_pair = int function(int);
1263 	alias da_get_escdelay = int function();
1264 	alias da_init_extended_color = int function(int, int, int, int);
1265 	alias da_init_extended_pair = int function(int, int, int);
1266 	alias da_key_defined = int function(const(char)*);
1267 	alias da_keyok = int function(int, bool);
1268 	alias da_reset_color_pairs = void function();
1269 	alias da_resize_term = int function(int, int);
1270 	alias da_resizeterm = int function(int, int);
1271 	alias da_set_escdelay = int function(int);
1272 	alias da_set_tabsize = int function(int);
1273 	alias da_use_default_colors = int function();
1274 	alias da_use_extended_names = int function(bool);
1275 	alias da_use_legacy_coding = int function(int);
1276 	alias da_use_screen = int function(SCREEN*, NCURSES_SCREEN_CB, void*);
1277 	alias da_use_window = int function(WINDOW*, NCURSES_WINDOW_CB, void*);
1278 	alias da_wresize = int function(WINDOW*, int, int);
1279 	alias da_nofilter = void function();
1280 	alias da_is_cleared = bool function(const(WINDOW)*);
1281 	alias da_is_idcok = bool function(const(WINDOW)*);
1282 	alias da_is_idlok = bool function(const(WINDOW)*);
1283 	alias da_is_immedok = bool function(const(WINDOW)*);
1284 	alias da_is_keypad = bool function(const(WINDOW)*);
1285 	alias da_is_leaveok = bool function(const(WINDOW)*);
1286 	alias da_is_nodelay = bool function(const(WINDOW)*);
1287 	alias da_is_notimeout = bool function(const(WINDOW)*);
1288 	alias da_is_pad = bool function(const(WINDOW)*);
1289 	alias da_is_scrollok = bool function(const(WINDOW)*);
1290 	alias da_is_subwin = bool function(const(WINDOW)*);
1291 	alias da_is_syncok = bool function(const(WINDOW)*);
1292 	alias da_wgetdelay = int function(const(WINDOW)*);
1293 	alias da_wgetscrreg = int function(const(WINDOW)*, int*, int*);
1294 	alias da_baudrate_sp = int function(SCREEN*);
1295 	alias da_beep_sp = int function(SCREEN*);
1296 	alias da_can_change_color_sp = bool function(SCREEN*);
1297 	alias da_cbreak_sp = int function(SCREEN*);
1298 	alias da_curs_set_sp = int function(SCREEN*, int);
1299 	alias da_color_content_sp = int function(SCREEN*, short, short*, short*, short*);
1300 	alias da_def_prog_mode_sp = int function(SCREEN*);
1301 	alias da_def_shell_mode_sp = int function(SCREEN*);
1302 	alias da_delay_output_sp = int function(SCREEN*, int);
1303 	alias da_doupdate_sp = int function(SCREEN*);
1304 	alias da_echo_sp = int function(SCREEN*);
1305 	alias da_endwin_sp = int function(SCREEN*);
1306 	alias da_erasechar_sp = char function(SCREEN*);
1307 	alias da_filter_sp = void function(SCREEN*);
1308 	alias da_flash_sp = int function(SCREEN*);
1309 	alias da_flushinp_sp = int function(SCREEN*);
1310 	alias da_halfdelay_sp = int function(SCREEN*, int);
1311 	alias da_has_colors_sp = bool function(SCREEN*);
1312 	alias da_has_ic_sp = bool function(SCREEN*);
1313 	alias da_has_il_sp = bool function(SCREEN*);
1314 	alias da_init_color_sp = int function(SCREEN*, short, short, short, short);
1315 	alias da_init_pair_sp = int function(SCREEN*, short, short, short);
1316 	alias da_intrflush_sp = int function(SCREEN*, WINDOW*, bool);
1317 	alias da_isendwin_sp = bool function(SCREEN*);
1318 	alias da_killchar_sp = char function(SCREEN*);
1319 	alias da_mvcur_sp = int function(SCREEN*, int, int, int, int);
1320 	alias da_napms_sp = int function(SCREEN*, int);
1321 	alias da_nl_sp = int function(SCREEN*);
1322 	alias da_nocbreak_sp = int function(SCREEN*);
1323 	alias da_noecho_sp = int function(SCREEN*);
1324 	alias da_nonl_sp = int function(SCREEN*);
1325 	alias da_noqiflush_sp = void function(SCREEN*);
1326 	alias da_noraw_sp = int function(SCREEN*);
1327 	alias da_pair_content_sp = int function(SCREEN*, short, short*, short*);
1328 	alias da_qiflush_sp = void function(SCREEN*);
1329 	alias da_raw_sp = int function(SCREEN*);
1330 	alias da_reset_prog_mode_sp = int function(SCREEN*);
1331 	alias da_reset_shell_mode_sp = int function(SCREEN*);
1332 	alias da_resetty_sp = int function(SCREEN*);
1333 	alias da_ripoffline_sp = int function(SCREEN*, int, int function (WINDOW*, int));
1334 	alias da_savetty_sp = int function(SCREEN*);
1335 	alias da_scr_init_sp = int function(SCREEN*, const(char)*);
1336 	alias da_scr_restore_sp = int function(SCREEN*, const(char)*);
1337 	alias da_scr_set_sp = int function(SCREEN*, const(char)*);
1338 	alias da_slk_attroff_sp = int function(SCREEN*, const chtype);
1339 	alias da_slk_attron_sp = int function(SCREEN*, const chtype);
1340 	alias da_slk_attrset_sp = int function(SCREEN*, const chtype);
1341 	alias da_slk_attr_sp = attr_t function(SCREEN*);
1342 	alias da_slk_attr_set_sp = int function(SCREEN*, const attr_t, short, void*);
1343 	alias da_slk_clear_sp = int function(SCREEN*);
1344 	alias da_slk_color_sp = int function(SCREEN*, short);
1345 	alias da_slk_init_sp = int function(SCREEN*, int);
1346 	alias da_slk_noutrefresh_sp = int function(SCREEN*);
1347 	alias da_slk_refresh_sp = int function(SCREEN*);
1348 	alias da_slk_restore_sp = int function(SCREEN*);
1349 	alias da_slk_set_sp = int function(SCREEN*, int, const(char)*, int);
1350 	alias da_slk_touch_sp = int function(SCREEN*);
1351 	alias da_start_color_sp = int function(SCREEN*);
1352 	alias da_termattrs_sp = chtype function(SCREEN*);
1353 	alias da_typeahead_sp = int function(SCREEN*, int);
1354 	alias da_ungetch_sp = int function(SCREEN*, int);
1355 	alias da_use_env_sp = void function(SCREEN*, bool);
1356 	alias da_use_tioctl_sp = void function(SCREEN*, bool);
1357 	alias da_vidattr_sp = int function(SCREEN*, chtype);
1358 	alias da_vidputs_sp = int function(SCREEN*, chtype, NCURSES_OUTC_sp);
1359 	alias da_keybound_sp = char* function(SCREEN*, int, int);
1360 	alias da_alloc_pair_sp = int function(SCREEN*, int, int);
1361 	alias da_assume_default_colors_sp = int function(SCREEN*, int, int);
1362 	alias da_define_key_sp = int function(SCREEN*, const(char)*, int);
1363 	alias da_extended_color_content_sp = int function(SCREEN*, int, int*, int*, int*);
1364 	alias da_extended_pair_content_sp = int function(SCREEN*, int, int*, int*);
1365 	alias da_extended_slk_color_sp = int function(SCREEN*, int);
1366 	alias da_get_escdelay_sp = int function(SCREEN*);
1367 	alias da_find_pair_sp = int function(SCREEN*, int, int);
1368 	alias da_free_pair_sp = int function(SCREEN*, int);
1369 	alias da_init_extended_color_sp = int function(SCREEN*, int, int, int, int);
1370 	alias da_init_extended_pair_sp = int function(SCREEN*, int, int, int);
1371 	alias da_is_term_resized_sp = bool function(SCREEN*, int, int);
1372 	alias da_key_defined_sp = int function(SCREEN*, const(char)*);
1373 	alias da_keyok_sp = int function(SCREEN*, int, bool);
1374 	alias da_nofilter_sp = void function(SCREEN*);
1375 	alias da_reset_color_pairs_sp = void function(SCREEN*);
1376 	alias da_resize_term_sp = int function(SCREEN*, int, int);
1377 	alias da_resizeterm_sp = int function(SCREEN*, int, int);
1378 	alias da_set_escdelay_sp = int function(SCREEN*, int);
1379 	alias da_set_tabsize_sp = int function(SCREEN*, int);
1380 	alias da_use_default_colors_sp = int function(SCREEN*);
1381 	alias da_use_legacy_coding_sp = int function(SCREEN*, int);
1382 	alias da_has_mouse = bool function();
1383 	alias da_getmouse = int function(MEVENT*);
1384 	alias da_ungetmouse = int function(MEVENT*);
1385 	alias da_mousemask = mmask_t function(mmask_t, mmask_t*);
1386 	alias da_wenclose = bool function(const(WINDOW)*, int, int);
1387 	alias da_mouseinterval = int function(int);
1388 	alias da_wmouse_trafo = bool function(const(WINDOW)*, int*, int*, bool);
1389 	alias da_mouse_trafo = bool function(int*, int*, bool);
1390 	alias da_has_mouse_sp = bool function(SCREEN*);
1391 	alias da_getmouse_sp = int function(SCREEN*, MEVENT*);
1392 	alias da_ungetmouse_sp = int function(SCREEN*, MEVENT*);
1393 	alias da_mousemask_sp = mmask_t function(SCREEN*, mmask_t, mmask_t*);
1394 	alias da_mouseinterval_sp = int function(SCREEN*, int);
1395 	alias da_mcprint = int function(char*, int);
1396 	alias da_has_key = int function(int);
1397 	alias da_has_key_sp = int function(SCREEN*, int);
1398 	alias da_mcprint_sp = int function(SCREEN*, char*, int);
1399 	alias da__tracef = void function(const(char)*, ...);
1400 	alias da__traceattr = char* function(attr_t);
1401 	alias da__traceattr2 = char* function(int, chtype);
1402 	alias da__tracechar = char* function(int);
1403 	alias da__tracechtype = char* function(chtype);
1404 	alias da__tracechtype2 = char* function(int, chtype);
1405 	alias da_trace = void function(const uint);
1406 
1407 	alias da_unctrl = char* function(chtype);
1408 	alias da_wunctrl = char* function(cchar_t*);
1409 
1410 	alias da_cursrc = WINDOW*;
1411 	alias da_newscr = WINDOW*;
1412 	alias da_stdscr = WINDOW*;
1413 	alias da_ttytype = char[];
1414 	alias da_COLORS = int;
1415 	alias da_COLOR_PAIRS = int;
1416 	alias da_COLS = int;
1417 	alias da_ESCDELAY = int;
1418 	alias da_LINES = int;
1419 	alias da_TABSIZE = int;
1420 }