1 // curses.h -> curses.d with dstep, adjusted by unleashy //
2 module pdcurses.curses;
3 
4 /* Public Domain Curses */
5 
6 /* $Id: curses.h,v 1.295 2008/07/15 17:13:25 wmcbrine Exp $ */
7 
8 /*----------------------------------------------------------------------*
9  *                              PDCurses                                *
10  *----------------------------------------------------------------------*/
11 
12 import core.stdc.config,
13        core.stdc.stdio,
14        core.stdc.stdarg;
15 
16 extern (C) nothrow:
17 
18 enum __PDCURSES__ = 1;
19 
20 /*man-start**************************************************************
21 
22 PDCurses definitions list:  (Only define those needed)
23 
24     XCURSES         True if compiling for X11.
25     PDC_RGB         True if you want to use RGB color definitions
26                     (Red = 1, Green = 2, Blue = 4) instead of BGR.
27     PDC_WIDE        True if building wide-character support.
28     PDC_DLL_BUILD   True if building a Win32 DLL.
29     NCURSES_MOUSE_VERSION   Use the ncurses mouse API instead
30                             of PDCurses' traditional mouse API.
31 
32 PDCurses portable platform definitions list:
33 
34     PDC_BUILD       Defines API build version.
35     PDCURSES        Enables access to PDCurses-only routines.
36     XOPEN           Always true.
37     SYSVcurses      True if you are compiling for SYSV portability.
38     BSDcurses       True if you are compiling for BSD portability.
39 
40 **man-end****************************************************************/
41 
42 enum PDC_BUILD = 3401;
43 
44 version = PDCURSES;    /* PDCurses-only routines */
45 version = XOPEN;       /* X/Open Curses routines */
46 version = SYSVcurses;  /* System V Curses routines */
47 version = BSDcurses;   /* BSD Curses routines */
48 version = CHTYPE_LONG; /* size of chtype; long */
49 
50 /*----------------------------------------------------------------------*/
51 
52 /* Required by X/Open usage below */
53 
54 /*----------------------------------------------------------------------
55  *
56  *  PDCurses Manifest Constants
57  *
58  */
59 
60 enum ERR = -1;
61 enum OK = 0;
62 
63 /*----------------------------------------------------------------------
64  *
65  *  PDCurses Type Declarations
66  *
67  */
68 
69 alias chtype = c_ulong; /* 16-bit attr + 16-bit char */
70 
71 alias attr_t = chtype;
72 
73 /*----------------------------------------------------------------------
74  *
75  *  PDCurses Mouse Interface -- SYSVR4, with extensions
76  *
77  */
78 
79 struct MOUSE_STATUS
80 {
81     int x; /* absolute column, 0 based, measured in characters */
82     int y; /* absolute row, 0 based, measured in characters */
83     short[3] button; /* state of each button */
84     int changes; /* flags indicating what has changed with the mouse */
85 }
86 
87 enum BUTTON_RELEASED       = 0x0000;
88 enum BUTTON_PRESSED        = 0x0001;
89 enum BUTTON_CLICKED        = 0x0002;
90 enum BUTTON_DOUBLE_CLICKED = 0x0003;
91 enum BUTTON_TRIPLE_CLICKED = 0x0004;
92 enum BUTTON_MOVED          = 0x0005; /* PDCurses */
93 enum WHEEL_SCROLLED        = 0x0006; /* PDCurses */
94 enum BUTTON_ACTION_MASK    = 0x0007; /* PDCurses */
95 
96 enum PDC_BUTTON_SHIFT     = 0x0008; /* PDCurses */
97 enum PDC_BUTTON_CONTROL   = 0x0010; /* PDCurses */
98 enum PDC_BUTTON_ALT       = 0x0020; /* PDCurses */
99 enum BUTTON_MODIFIER_MASK = 0x0038; /* PDCurses */
100 
101 extern (D) pragma (inline, true)
102 auto MOUSE_X_POS()
103 {
104     return Mouse_status.x;
105 }
106 
107 extern (D) pragma (inline, true)
108 auto MOUSE_Y_POS()
109 {
110     return Mouse_status.y;
111 }
112 
113 /*
114  * Bits associated with the .changes field:
115  *   3         2         1         0
116  * 210987654321098765432109876543210
117  *                                 1 <- button 1 has changed
118  *                                10 <- button 2 has changed
119  *                               100 <- button 3 has changed
120  *                              1000 <- mouse has moved
121  *                             10000 <- mouse position report
122  *                            100000 <- mouse wheel up
123  *                           1000000 <- mouse wheel down
124  */
125 
126 enum PDC_MOUSE_MOVED      = 0x0008;
127 enum PDC_MOUSE_POSITION   = 0x0010;
128 enum PDC_MOUSE_WHEEL_UP   = 0x0020;
129 enum PDC_MOUSE_WHEEL_DOWN = 0x0040;
130 
131 extern (D) pragma (inline, true)
132 auto A_BUTTON_CHANGED()
133 {
134     return Mouse_status.changes & 7;
135 }
136 
137 extern (D) pragma (inline, true)
138 auto MOUSE_MOVED()
139 {
140     return Mouse_status.changes & PDC_MOUSE_MOVED;
141 }
142 
143 extern (D) pragma (inline, true)
144 auto MOUSE_POS_REPORT()
145 {
146     return Mouse_status.changes & PDC_MOUSE_POSITION;
147 }
148 
149 extern (D) pragma (inline, true)
150 auto BUTTON_CHANGED(T)(auto ref T x)
151 {
152     return Mouse_status.changes & (1 << (x - 1));
153 }
154 
155 extern (D) pragma (inline, true)
156 auto BUTTON_STATUS(T)(auto ref T x)
157 {
158     return Mouse_status.button[x - 1];
159 }
160 
161 extern (D) pragma (inline, true)
162 auto MOUSE_WHEEL_UP()
163 {
164     return Mouse_status.changes & PDC_MOUSE_WHEEL_UP;
165 }
166 
167 extern (D) pragma (inline, true)
168 auto MOUSE_WHEEL_DOWN()
169 {
170     return Mouse_status.changes & PDC_MOUSE_WHEEL_DOWN;
171 }
172 
173 /* mouse bit-masks */
174 
175 enum BUTTON1_RELEASED       = 0x00000001L;
176 enum BUTTON1_PRESSED        = 0x00000002L;
177 enum BUTTON1_CLICKED        = 0x00000004L;
178 enum BUTTON1_DOUBLE_CLICKED = 0x00000008L;
179 enum BUTTON1_TRIPLE_CLICKED = 0x00000010L;
180 enum BUTTON1_MOVED          = 0x00000010L; /* PDCurses */
181 
182 enum BUTTON2_RELEASED       = 0x00000020L;
183 enum BUTTON2_PRESSED        = 0x00000040L;
184 enum BUTTON2_CLICKED        = 0x00000080L;
185 enum BUTTON2_DOUBLE_CLICKED = 0x00000100L;
186 enum BUTTON2_TRIPLE_CLICKED = 0x00000200L;
187 enum BUTTON2_MOVED          = 0x00000200L; /* PDCurses */
188 
189 enum BUTTON3_RELEASED       = 0x00000400L;
190 enum BUTTON3_PRESSED        = 0x00000800L;
191 enum BUTTON3_CLICKED        = 0x00001000L;
192 enum BUTTON3_DOUBLE_CLICKED = 0x00002000L;
193 enum BUTTON3_TRIPLE_CLICKED = 0x00004000L;
194 enum BUTTON3_MOVED          = 0x00004000L; /* PDCurses */
195 
196 /* For the ncurses-compatible functions only, BUTTON4_PRESSED and
197    BUTTON5_PRESSED are returned for mouse scroll wheel up and down;
198    otherwise PDCurses doesn't support buttons 4 and 5 */
199 
200 enum BUTTON4_RELEASED       = 0x00008000L;
201 enum BUTTON4_PRESSED        = 0x00010000L;
202 enum BUTTON4_CLICKED        = 0x00020000L;
203 enum BUTTON4_DOUBLE_CLICKED = 0x00040000L;
204 enum BUTTON4_TRIPLE_CLICKED = 0x00080000L;
205 
206 enum BUTTON5_RELEASED       = 0x00100000L;
207 enum BUTTON5_PRESSED        = 0x00200000L;
208 enum BUTTON5_CLICKED        = 0x00400000L;
209 enum BUTTON5_DOUBLE_CLICKED = 0x00800000L;
210 enum BUTTON5_TRIPLE_CLICKED = 0x01000000L;
211 
212 enum MOUSE_WHEEL_SCROLL      = 0x02000000L; /* PDCurses */
213 enum BUTTON_MODIFIER_SHIFT   = 0x04000000L; /* PDCurses */
214 enum BUTTON_MODIFIER_CONTROL = 0x08000000L; /* PDCurses */
215 enum BUTTON_MODIFIER_ALT     = 0x10000000L; /* PDCurses */
216 
217 enum ALL_MOUSE_EVENTS      = 0x1fffffffL;
218 enum REPORT_MOUSE_POSITION = 0x20000000L;
219 
220 /* ncurses mouse interface */
221 
222 alias mmask_t = c_ulong;
223 
224 struct MEVENT
225 {
226     short id;       /* unused, always 0 */
227     int x;
228     int y;
229     int z;          /* x, y same as MOUSE_STATUS; z unused */
230     mmask_t bstate; /* equivalent to changes + button[], but
231                        in the same format as used for mousemask() */
232 }
233 
234 enum BUTTON_SHIFT   = PDC_BUTTON_SHIFT;
235 enum BUTTON_CONTROL = PDC_BUTTON_CONTROL;
236 enum BUTTON_ALT     = PDC_BUTTON_ALT;
237 
238 /*----------------------------------------------------------------------
239  *
240  *  PDCurses Structure Definitions
241  *
242  */
243 
244 struct _win               /* definition of a window */
245 {
246     int      _cury;       /* current pseudo-cursor */
247     int      _curx;
248     int      _maxy;       /* max window coordinates */
249     int      _maxx;
250     int      _begy;       /* origin on screen */
251     int      _begx;
252     int      _flags;      /* window properties */
253     chtype   _attrs;      /* standard attributes and colors */
254     chtype   _bkgd;       /* background, normally blank */
255     bool     _clear;      /* causes clear at next refresh */
256     bool     _leaveit;    /* leaves cursor where it is */
257     bool     _scroll;     /* allows window scrolling */
258     bool     _nodelay;    /* input character wait flag */
259     bool     _immed;      /* immediate update flag */
260     bool     _sync;       /* synchronise window ancestors */
261     bool     _use_keypad; /* flags keypad key mode active */
262     chtype** _y;          /* pointer to line pointer array */
263     int*     _firstch;    /* first changed character in line */
264     int*     _lastch;     /* last changed character in line */
265     int      _tmarg;      /* top of scrolling region */
266     int      _bmarg;      /* bottom of scrolling region */
267     int      _delayms;    /* milliseconds of delay for getch() */
268     int      _parx;
269     int      _pary;       /* coords relative to parent (0,0) */
270     _win*    _parent;     /* subwin's pointer to parent win */
271 }
272 
273 alias WINDOW = _win;
274 
275 /* Avoid using the SCREEN struct directly -- use the corresponding
276    functions if possible. This struct may eventually be made private. */
277 
278 struct SCREEN
279 {
280     bool  alive;       /* if initscr() called, and not endwin() */
281     bool  autocr;      /* if cr -> lf */
282     bool  cbreak;      /* if terminal unbuffered */
283     bool  echo;        /* if terminal echo */
284     bool  raw_inp;     /* raw input mode (v. cooked input) */
285     bool  raw_out;     /* raw output mode (7 v. 8 bits) */
286     bool  audible;     /* FALSE if the bell is visual */
287     bool  mono;        /* TRUE if current screen is mono */
288     bool  resized;     /* TRUE if TERM has been resized */
289     bool  orig_attr;   /* TRUE if we have the original colors */
290     short orig_fore;   /* original screen foreground color */
291     short orig_back;   /* original screen foreground color */
292     int   cursrow;     /* position of physical cursor */
293     int   curscol;     /* position of physical cursor */
294     int   visibility;  /* visibility of cursor */
295     int   orig_cursor; /* original cursor size */
296     int   lines;       /* new value for LINES */
297     int   cols;        /* new value for COLS */
298     c_ulong _trap_mbe;         /* trap these mouse button events */
299     c_ulong _map_mbe_to_key;   /* map mouse buttons to slk */
300     int     mouse_wait;        /* time to wait (in ms) for a
301                                   button release after a press, in
302                                   order to count it as a click */
303     int     slklines;          /* lines in use by slk_init() */
304     WINDOW* slk_winptr;        /* window for slk */
305     int linesrippedoff;        /* lines ripped off via ripoffline() */
306     int linesrippedoffontop;   /* lines ripped off on
307                                   top via ripoffline() */
308     int delaytenths;           /* 1/10ths second to wait block
309                                   getch() for */
310     bool _preserve;            /* TRUE if screen background
311                                   to be preserved */
312     int _restore;              /* specifies if screen background
313                                   to be restored, and how */
314     bool save_key_modifiers;   /* TRUE if each key modifiers saved
315                                   with each key press */
316     bool return_key_modifiers; /* TRUE if modifier keys are
317                                   returned as "real" keys */
318     bool key_code;             /* TRUE if last key is a special key;
319                                   used internally by get_wch() */
320 
321     version (XCURSES) {
322         int   XcurscrSize;    /* size of Xcurscr shared memory block */
323         bool  sb_on;
324         int   sb_viewport_y;
325         int   sb_viewport_x;
326         int   sb_total_y;
327         int   sb_total_x;
328         int   sb_cur_y;
329         int   sb_cur_x;
330     }
331 
332     short line_color; /* color of line attributes - default -1 */
333 }
334 
335 /*----------------------------------------------------------------------
336  *
337  *  PDCurses External Variables
338  *
339  */
340 
341 extern __gshared int          LINES;        /* terminal height */
342 extern __gshared int          COLS;         /* terminal width */
343 extern __gshared WINDOW*      stdscr;       /* the default screen window */
344 extern __gshared WINDOW*      curscr;       /* the current screen image */
345 extern __gshared SCREEN*      SP;           /* curses variables */
346 extern __gshared MOUSE_STATUS Mouse_status;
347 extern __gshared int          COLORS;
348 extern __gshared int          COLOR_PAIRS;
349 extern __gshared int          TABSIZE;
350 extern __gshared chtype[]     acs_map;      /* alternate character set map */
351 extern __gshared char[]       ttytype;      /* terminal name/description */
352 
353 /*man-start**************************************************************
354 
355 PDCurses Text Attributes
356 ========================
357 
358 Originally, PDCurses used a short (16 bits) for its chtype. To include
359 color, a number of things had to be sacrificed from the strict Unix and
360 System V support. The main problem was fitting all character attributes
361 and color into an unsigned char (all 8 bits!).
362 
363 Today, PDCurses by default uses a long (32 bits) for its chtype, as in
364 System V. The short chtype is still available, by undefining CHTYPE_LONG
365 and rebuilding the library.
366 
367 The following is the structure of a win->_attrs chtype:
368 
369 short form:
370 
371 -------------------------------------------------
372 |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
373 -------------------------------------------------
374   color number |  attrs |   character eg 'a'
375 
376 The available non-color attributes are bold, reverse and blink. Others
377 have no effect. The high order char is an index into an array of
378 physical colors (defined in color.c) -- 32 foreground/background color
379 pairs (5 bits) plus 3 bits for other attributes.
380 
381 long form:
382 
383 ----------------------------------------------------------------------------
384 |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|..| 3| 2| 1| 0|
385 ----------------------------------------------------------------------------
386       color number      |     modifiers         |      character eg 'a'
387 
388 The available non-color attributes are bold, underline, invisible,
389 right-line, left-line, protect, reverse and blink. 256 color pairs (8
390 bits), 8 bits for other attributes, and 16 bits for character data.
391 
392 **man-end****************************************************************/
393 
394 /*** Video attribute macros ***/
395 
396 enum A_NORMAL     = cast(chtype) 0;
397 
398 enum A_ALTCHARSET = cast(chtype) 0x00010000;
399 enum A_RIGHTLINE  = cast(chtype) 0x00020000;
400 enum A_LEFTLINE   = cast(chtype) 0x00040000;
401 enum A_INVIS      = cast(chtype) 0x00080000;
402 enum A_UNDERLINE  = cast(chtype) 0x00100000;
403 enum A_REVERSE    = cast(chtype) 0x00200000;
404 enum A_BLINK      = cast(chtype) 0x00400000;
405 enum A_BOLD       = cast(chtype) 0x00800000;
406 
407 enum A_ATTRIBUTES = cast(chtype) 0xffff0000;
408 enum A_CHARTEXT   = cast(chtype) 0x0000ffff;
409 enum A_COLOR      = cast(chtype) 0xff000000;
410 
411 enum A_ITALIC     = A_INVIS;
412 enum A_PROTECT    = A_UNDERLINE | A_LEFTLINE | A_RIGHTLINE;
413 
414 enum PDC_ATTR_SHIFT  = 19;
415 enum PDC_COLOR_SHIFT = 24;
416 
417 enum A_STANDOUT = A_REVERSE | A_BOLD; /* X/Open */
418 enum A_DIM      = A_NORMAL;
419 
420 enum CHR_MSK = A_CHARTEXT; /* Obsolete */
421 enum ATR_MSK = A_ATTRIBUTES; /* Obsolete */
422 enum ATR_NRM = A_NORMAL; /* Obsolete */
423 
424 /* For use with attr_t -- X/Open says, "these shall be distinct", so
425    this is a non-conforming implementation. */
426 
427 enum WA_ALTCHARSET = A_ALTCHARSET;
428 enum WA_BLINK      = A_BLINK;
429 enum WA_BOLD       = A_BOLD;
430 enum WA_DIM        = A_DIM;
431 enum WA_INVIS      = A_INVIS;
432 enum WA_LEFT       = A_LEFTLINE;
433 enum WA_PROTECT    = A_PROTECT;
434 enum WA_REVERSE    = A_REVERSE;
435 enum WA_RIGHT      = A_RIGHTLINE;
436 enum WA_STANDOUT   = A_STANDOUT;
437 enum WA_UNDERLINE  = A_UNDERLINE;
438 
439 enum WA_HORIZONTAL = A_NORMAL;
440 enum WA_LOW        = A_NORMAL;
441 enum WA_TOP        = A_NORMAL;
442 enum WA_VERTICAL   = A_NORMAL;
443 
444 /*** Alternate character set macros ***/
445 
446 /* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET
447    'n' = 16-bit chtype; it gets the fallback set because no bit is
448          available for A_ALTCHARSET */
449 
450 extern (D) pragma (inline, true)
451 auto ACS_PICK(T0, T1)(auto ref T0 w, auto ref T1 n)
452 {
453     return cast(chtype) w | A_ALTCHARSET;
454 }
455 
456 /* VT100-compatible symbols -- box chars */
457 
458 enum ACS_ULCORNER = ACS_PICK('l', '+');
459 enum ACS_LLCORNER = ACS_PICK('m', '+');
460 enum ACS_URCORNER = ACS_PICK('k', '+');
461 enum ACS_LRCORNER = ACS_PICK('j', '+');
462 enum ACS_RTEE     = ACS_PICK('u', '+');
463 enum ACS_LTEE     = ACS_PICK('t', '+');
464 enum ACS_BTEE     = ACS_PICK('v', '+');
465 enum ACS_TTEE     = ACS_PICK('w', '+');
466 enum ACS_HLINE    = ACS_PICK('q', '-');
467 enum ACS_VLINE    = ACS_PICK('x', '|');
468 enum ACS_PLUS     = ACS_PICK('n', '+');
469 
470 /* VT100-compatible symbols -- other */
471 
472 enum ACS_S1      = ACS_PICK('o', '-');
473 enum ACS_S9      = ACS_PICK('s', '_');
474 enum ACS_DIAMOND = ACS_PICK('`', '+');
475 enum ACS_CKBOARD = ACS_PICK('a', ':');
476 enum ACS_DEGREE  = ACS_PICK('f', '\'');
477 enum ACS_PLMINUS = ACS_PICK('g', '#');
478 enum ACS_BULLET  = ACS_PICK('~', 'o');
479 
480 /* Teletype 5410v1 symbols -- these are defined in SysV curses, but
481    are not well-supported by most terminals. Stick to VT100 characters
482    for optimum portability. */
483 
484 enum ACS_LARROW  = ACS_PICK(',', '<');
485 enum ACS_RARROW  = ACS_PICK('+', '>');
486 enum ACS_DARROW  = ACS_PICK('.', 'v');
487 enum ACS_UARROW  = ACS_PICK('-', '^');
488 enum ACS_BOARD   = ACS_PICK('h', '#');
489 enum ACS_LANTERN = ACS_PICK('i', '*');
490 enum ACS_BLOCK   = ACS_PICK('0', '#');
491 
492 /* That goes double for these -- undocumented SysV symbols. Don't use
493    them. */
494 
495 enum ACS_S3       = ACS_PICK('p', '-');
496 enum ACS_S7       = ACS_PICK('r', '-');
497 enum ACS_LEQUAL   = ACS_PICK('y', '<');
498 enum ACS_GEQUAL   = ACS_PICK('z', '>');
499 enum ACS_PI       = ACS_PICK('{', 'n');
500 enum ACS_NEQUAL   = ACS_PICK('|', '+');
501 enum ACS_STERLING = ACS_PICK('}', 'L');
502 
503 /* Box char aliases */
504 
505 enum ACS_BSSB = ACS_ULCORNER;
506 enum ACS_SSBB = ACS_LLCORNER;
507 enum ACS_BBSS = ACS_URCORNER;
508 enum ACS_SBBS = ACS_LRCORNER;
509 enum ACS_SBSS = ACS_RTEE;
510 enum ACS_SSSB = ACS_LTEE;
511 enum ACS_SSBS = ACS_BTEE;
512 enum ACS_BSSS = ACS_TTEE;
513 enum ACS_BSBS = ACS_HLINE;
514 enum ACS_SBSB = ACS_VLINE;
515 enum ACS_SSSS = ACS_PLUS;
516 
517 /* cchar_t aliases */
518 
519 /*** Color macros ***/
520 
521 enum short COLOR_BLACK = 0;
522 
523 version (PDC_RGB) {
524     /* RGB */
525     enum short COLOR_RED   = 1;
526     enum short COLOR_GREEN = 2;
527     enum short COLOR_BLUE  = 4;
528 } else {
529     /* BGR */
530     enum short COLOR_BLUE  = 1;
531     enum short COLOR_GREEN = 2;
532     enum short COLOR_RED   = 4;
533 }
534 
535 enum short COLOR_CYAN    = COLOR_BLUE | COLOR_GREEN;
536 enum short COLOR_MAGENTA = COLOR_RED | COLOR_BLUE;
537 enum short COLOR_YELLOW  = COLOR_RED | COLOR_GREEN;
538 
539 enum short COLOR_WHITE = 7;
540 
541 /*----------------------------------------------------------------------
542  *
543  *  Function and Keypad Key Definitions.
544  *  Many are just for compatibility.
545  *
546  */
547 
548 enum KEY_CODE_YES = 0x100; /* If get_wch() gives a key code */
549 
550 enum KEY_BREAK     = 0x101; /* Not on PC KBD */
551 enum KEY_DOWN      = 0x102; /* Down arrow key */
552 enum KEY_UP        = 0x103; /* Up arrow key */
553 enum KEY_LEFT      = 0x104; /* Left arrow key */
554 enum KEY_RIGHT     = 0x105; /* Right arrow key */
555 enum KEY_HOME      = 0x106; /* home key */
556 enum KEY_BACKSPACE = 0x107; /* not on pc */
557 enum KEY_F0        = 0x108; /* function keys; 64 reserved */
558 
559 enum KEY_DL        = 0x148; /* delete line */
560 enum KEY_IL        = 0x149; /* insert line */
561 enum KEY_DC        = 0x14a; /* delete character */
562 enum KEY_IC        = 0x14b; /* insert char or enter ins mode */
563 enum KEY_EIC       = 0x14c; /* exit insert char mode */
564 enum KEY_CLEAR     = 0x14d; /* clear screen */
565 enum KEY_EOS       = 0x14e; /* clear to end of screen */
566 enum KEY_EOL       = 0x14f; /* clear to end of line */
567 enum KEY_SF        = 0x150; /* scroll 1 line forward */
568 enum KEY_SR        = 0x151; /* scroll 1 line back (reverse) */
569 enum KEY_NPAGE     = 0x152; /* next page */
570 enum KEY_PPAGE     = 0x153; /* previous page */
571 enum KEY_STAB      = 0x154; /* set tab */
572 enum KEY_CTAB      = 0x155; /* clear tab */
573 enum KEY_CATAB     = 0x156; /* clear all tabs */
574 enum KEY_ENTER     = 0x157; /* enter or send (unreliable) */
575 enum KEY_SRESET    = 0x158; /* soft/reset (partial/unreliable) */
576 enum KEY_RESET     = 0x159; /* reset/hard reset (unreliable) */
577 enum KEY_PRINT     = 0x15a; /* print/copy */
578 enum KEY_LL        = 0x15b; /* home down/bottom (lower left) */
579 enum KEY_ABORT     = 0x15c; /* abort/terminate key (any) */
580 enum KEY_SHELP     = 0x15d; /* short help */
581 enum KEY_LHELP     = 0x15e; /* long help */
582 enum KEY_BTAB      = 0x15f; /* Back tab key */
583 enum KEY_BEG       = 0x160; /* beg(inning) key */
584 enum KEY_CANCEL    = 0x161; /* cancel key */
585 enum KEY_CLOSE     = 0x162; /* close key */
586 enum KEY_COMMAND   = 0x163; /* cmd (command) key */
587 enum KEY_COPY      = 0x164; /* copy key */
588 enum KEY_CREATE    = 0x165; /* create key */
589 enum KEY_END       = 0x166; /* end key */
590 enum KEY_EXIT      = 0x167; /* exit key */
591 enum KEY_FIND      = 0x168; /* find key */
592 enum KEY_HELP      = 0x169; /* help key */
593 enum KEY_MARK      = 0x16a; /* mark key */
594 enum KEY_MESSAGE   = 0x16b; /* message key */
595 enum KEY_MOVE      = 0x16c; /* move key */
596 enum KEY_NEXT      = 0x16d; /* next object key */
597 enum KEY_OPEN      = 0x16e; /* open key */
598 enum KEY_OPTIONS   = 0x16f; /* options key */
599 enum KEY_PREVIOUS  = 0x170; /* previous object key */
600 enum KEY_REDO      = 0x171; /* redo key */
601 enum KEY_REFERENCE = 0x172; /* ref(erence) key */
602 enum KEY_REFRESH   = 0x173; /* refresh key */
603 enum KEY_REPLACE   = 0x174; /* replace key */
604 enum KEY_RESTART   = 0x175; /* restart key */
605 enum KEY_RESUME    = 0x176; /* resume key */
606 enum KEY_SAVE      = 0x177; /* save key */
607 enum KEY_SBEG      = 0x178; /* shifted beginning key */
608 enum KEY_SCANCEL   = 0x179; /* shifted cancel key */
609 enum KEY_SCOMMAND  = 0x17a; /* shifted command key */
610 enum KEY_SCOPY     = 0x17b; /* shifted copy key */
611 enum KEY_SCREATE   = 0x17c; /* shifted create key */
612 enum KEY_SDC       = 0x17d; /* shifted delete char key */
613 enum KEY_SDL       = 0x17e; /* shifted delete line key */
614 enum KEY_SELECT    = 0x17f; /* select key */
615 enum KEY_SEND      = 0x180; /* shifted end key */
616 enum KEY_SEOL      = 0x181; /* shifted clear line key */
617 enum KEY_SEXIT     = 0x182; /* shifted exit key */
618 enum KEY_SFIND     = 0x183; /* shifted find key */
619 enum KEY_SHOME     = 0x184; /* shifted home key */
620 enum KEY_SIC       = 0x185; /* shifted input key */
621 
622 enum KEY_SLEFT     = 0x187; /* shifted left arrow key */
623 enum KEY_SMESSAGE  = 0x188; /* shifted message key */
624 enum KEY_SMOVE     = 0x189; /* shifted move key */
625 enum KEY_SNEXT     = 0x18a; /* shifted next key */
626 enum KEY_SOPTIONS  = 0x18b; /* shifted options key */
627 enum KEY_SPREVIOUS = 0x18c; /* shifted prev key */
628 enum KEY_SPRINT    = 0x18d; /* shifted print key */
629 enum KEY_SREDO     = 0x18e; /* shifted redo key */
630 enum KEY_SREPLACE  = 0x18f; /* shifted replace key */
631 enum KEY_SRIGHT    = 0x190; /* shifted right arrow */
632 enum KEY_SRSUME    = 0x191; /* shifted resume key */
633 enum KEY_SSAVE     = 0x192; /* shifted save key */
634 enum KEY_SSUSPEND  = 0x193; /* shifted suspend key */
635 enum KEY_SUNDO     = 0x194; /* shifted undo key */
636 enum KEY_SUSPEND   = 0x195; /* suspend key */
637 enum KEY_UNDO      = 0x196; /* undo key */
638 
639 /* PDCurses-specific key definitions -- PC only */
640 
641 enum ALT_0 = 0x197;
642 enum ALT_1 = 0x198;
643 enum ALT_2 = 0x199;
644 enum ALT_3 = 0x19a;
645 enum ALT_4 = 0x19b;
646 enum ALT_5 = 0x19c;
647 enum ALT_6 = 0x19d;
648 enum ALT_7 = 0x19e;
649 enum ALT_8 = 0x19f;
650 enum ALT_9 = 0x1a0;
651 enum ALT_A = 0x1a1;
652 enum ALT_B = 0x1a2;
653 enum ALT_C = 0x1a3;
654 enum ALT_D = 0x1a4;
655 enum ALT_E = 0x1a5;
656 enum ALT_F = 0x1a6;
657 enum ALT_G = 0x1a7;
658 enum ALT_H = 0x1a8;
659 enum ALT_I = 0x1a9;
660 enum ALT_J = 0x1aa;
661 enum ALT_K = 0x1ab;
662 enum ALT_L = 0x1ac;
663 enum ALT_M = 0x1ad;
664 enum ALT_N = 0x1ae;
665 enum ALT_O = 0x1af;
666 enum ALT_P = 0x1b0;
667 enum ALT_Q = 0x1b1;
668 enum ALT_R = 0x1b2;
669 enum ALT_S = 0x1b3;
670 enum ALT_T = 0x1b4;
671 enum ALT_U = 0x1b5;
672 enum ALT_V = 0x1b6;
673 enum ALT_W = 0x1b7;
674 enum ALT_X = 0x1b8;
675 enum ALT_Y = 0x1b9;
676 enum ALT_Z = 0x1ba;
677 
678 enum CTL_LEFT  = 0x1bb; /* Control-Left-Arrow */
679 enum CTL_RIGHT = 0x1bc;
680 enum CTL_PGUP  = 0x1bd;
681 enum CTL_PGDN  = 0x1be;
682 enum CTL_HOME  = 0x1bf;
683 enum CTL_END   = 0x1c0;
684 
685 enum KEY_A1 = 0x1c1; /* upper left on Virtual keypad */
686 enum KEY_A2 = 0x1c2; /* upper middle on Virt. keypad */
687 enum KEY_A3 = 0x1c3; /* upper right on Vir. keypad */
688 enum KEY_B1 = 0x1c4; /* middle left on Virt. keypad */
689 enum KEY_B2 = 0x1c5; /* center on Virt. keypad */
690 enum KEY_B3 = 0x1c6; /* middle right on Vir. keypad */
691 enum KEY_C1 = 0x1c7; /* lower left on Virt. keypad */
692 enum KEY_C2 = 0x1c8; /* lower middle on Virt. keypad */
693 enum KEY_C3 = 0x1c9; /* lower right on Vir. keypad */
694 
695 enum PADSLASH      = 0x1ca; /* slash on keypad */
696 enum PADENTER      = 0x1cb; /* enter on keypad */
697 enum CTL_PADENTER  = 0x1cc; /* ctl-enter on keypad */
698 enum ALT_PADENTER  = 0x1cd; /* alt-enter on keypad */
699 enum PADSTOP       = 0x1ce; /* stop on keypad */
700 enum PADSTAR       = 0x1cf; /* star on keypad */
701 enum PADMINUS      = 0x1d0; /* minus on keypad */
702 enum PADPLUS       = 0x1d1; /* plus on keypad */
703 enum CTL_PADSTOP   = 0x1d2; /* ctl-stop on keypad */
704 enum CTL_PADCENTER = 0x1d3; /* ctl-enter on keypad */
705 enum CTL_PADPLUS   = 0x1d4; /* ctl-plus on keypad */
706 enum CTL_PADMINUS  = 0x1d5; /* ctl-minus on keypad */
707 enum CTL_PADSLASH  = 0x1d6; /* ctl-slash on keypad */
708 enum CTL_PADSTAR   = 0x1d7; /* ctl-star on keypad */
709 enum ALT_PADPLUS   = 0x1d8; /* alt-plus on keypad */
710 enum ALT_PADMINUS  = 0x1d9; /* alt-minus on keypad */
711 enum ALT_PADSLASH  = 0x1da; /* alt-slash on keypad */
712 enum ALT_PADSTAR   = 0x1db; /* alt-star on keypad */
713 enum ALT_PADSTOP   = 0x1dc; /* alt-stop on keypad */
714 enum CTL_INS       = 0x1dd; /* ctl-insert */
715 enum ALT_DEL       = 0x1de; /* alt-delete */
716 enum ALT_INS       = 0x1df; /* alt-insert */
717 enum CTL_UP        = 0x1e0; /* ctl-up arrow */
718 enum CTL_DOWN      = 0x1e1; /* ctl-down arrow */
719 enum CTL_TAB       = 0x1e2; /* ctl-tab */
720 enum ALT_TAB       = 0x1e3;
721 enum ALT_MINUS     = 0x1e4;
722 enum ALT_EQUAL     = 0x1e5;
723 enum ALT_HOME      = 0x1e6;
724 enum ALT_PGUP      = 0x1e7;
725 enum ALT_PGDN      = 0x1e8;
726 enum ALT_END       = 0x1e9;
727 enum ALT_UP        = 0x1ea; /* alt-up arrow */
728 enum ALT_DOWN      = 0x1eb; /* alt-down arrow */
729 enum ALT_RIGHT     = 0x1ec; /* alt-right arrow */
730 enum ALT_LEFT      = 0x1ed; /* alt-left arrow */
731 enum ALT_ENTER     = 0x1ee; /* alt-enter */
732 enum ALT_ESC       = 0x1ef; /* alt-escape */
733 enum ALT_BQUOTE    = 0x1f0; /* alt-back quote */
734 enum ALT_LBRACKET  = 0x1f1; /* alt-left bracket */
735 enum ALT_RBRACKET  = 0x1f2; /* alt-right bracket */
736 enum ALT_SEMICOLON = 0x1f3; /* alt-semi-colon */
737 enum ALT_FQUOTE    = 0x1f4; /* alt-forward quote */
738 enum ALT_COMMA     = 0x1f5; /* alt-comma */
739 enum ALT_STOP      = 0x1f6; /* alt-stop */
740 enum ALT_FSLASH    = 0x1f7; /* alt-forward slash */
741 enum ALT_BKSP      = 0x1f8; /* alt-backspace */
742 enum CTL_BKSP      = 0x1f9; /* ctl-backspace */
743 enum PAD0          = 0x1fa; /* keypad 0 */
744 
745 enum CTL_PAD0 = 0x1fb; /* ctl-keypad 0 */
746 enum CTL_PAD1 = 0x1fc;
747 enum CTL_PAD2 = 0x1fd;
748 enum CTL_PAD3 = 0x1fe;
749 enum CTL_PAD4 = 0x1ff;
750 enum CTL_PAD5 = 0x200;
751 enum CTL_PAD6 = 0x201;
752 enum CTL_PAD7 = 0x202;
753 enum CTL_PAD8 = 0x203;
754 enum CTL_PAD9 = 0x204;
755 
756 enum ALT_PAD0 = 0x205; /* alt-keypad 0 */
757 enum ALT_PAD1 = 0x206;
758 enum ALT_PAD2 = 0x207;
759 enum ALT_PAD3 = 0x208;
760 enum ALT_PAD4 = 0x209;
761 enum ALT_PAD5 = 0x20a;
762 enum ALT_PAD6 = 0x20b;
763 enum ALT_PAD7 = 0x20c;
764 enum ALT_PAD8 = 0x20d;
765 enum ALT_PAD9 = 0x20e;
766 
767 enum CTL_DEL    = 0x20f; /* clt-delete */
768 enum ALT_BSLASH = 0x210; /* alt-back slash */
769 enum CTL_ENTER  = 0x211; /* ctl-enter */
770 
771 enum SHF_PADENTER = 0x212; /* shift-enter on keypad */
772 enum SHF_PADSLASH = 0x213; /* shift-slash on keypad */
773 enum SHF_PADSTAR  = 0x214; /* shift-star  on keypad */
774 enum SHF_PADPLUS  = 0x215; /* shift-plus  on keypad */
775 enum SHF_PADMINUS = 0x216; /* shift-minus on keypad */
776 enum SHF_UP       = 0x217; /* shift-up on keypad */
777 enum SHF_DOWN     = 0x218; /* shift-down on keypad */
778 enum SHF_IC       = 0x219; /* shift-insert on keypad */
779 enum SHF_DC       = 0x21a; /* shift-delete on keypad */
780 
781 enum KEY_MOUSE     = 0x21b; /* "mouse" key */
782 enum KEY_SHIFT_L   = 0x21c; /* Left-shift */
783 enum KEY_SHIFT_R   = 0x21d; /* Right-shift */
784 enum KEY_CONTROL_L = 0x21e; /* Left-control */
785 enum KEY_CONTROL_R = 0x21f; /* Right-control */
786 enum KEY_ALT_L     = 0x220; /* Left-alt */
787 enum KEY_ALT_R     = 0x221; /* Right-alt */
788 enum KEY_RESIZE    = 0x222; /* Window resize */
789 enum KEY_SUP       = 0x223; /* Shifted up arrow */
790 enum KEY_SDOWN     = 0x224; /* Shifted down arrow */
791 
792 enum KEY_MIN = KEY_BREAK; /* Minimum curses key value */
793 enum KEY_MAX = KEY_SDOWN; /* Maximum curses key */
794 
795 extern (D) pragma(inline, true)
796 auto KEY_F(T)(auto ref T n)
797 {
798     return KEY_F0 + n;
799 }
800 
801 /*----------------------------------------------------------------------
802  *
803  *  PDCurses Function Declarations
804  *
805  */
806 
807 /* Standard */
808 
809 int     addch (const chtype);
810 int     addchnstr (const(chtype)*, int);
811 int     addchstr (const(chtype)*);
812 int     addnstr (const(char)*, int);
813 int     addstr (const(char)*);
814 int     attroff (chtype);
815 int     attron (chtype);
816 int     attrset (chtype);
817 int     attr_get (attr_t*, short*, void*);
818 int     attr_off (attr_t, void*);
819 int     attr_on (attr_t, void*);
820 int     attr_set (attr_t, short, void*);
821 int     baudrate ();
822 int     beep ();
823 int     bkgd (chtype);
824 void    bkgdset (chtype);
825 int     border (chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
826 int     box (WINDOW*, chtype, chtype);
827 bool    can_change_color ();
828 int     cbreak ();
829 int     chgat (int, attr_t, short, const(void)*);
830 int     clearok (WINDOW*, bool);
831 int     clear ();
832 int     clrtobot ();
833 int     clrtoeol ();
834 int     color_content (short, short*, short*, short*);
835 int     color_set (short, void*);
836 int     copywin (const(WINDOW)*, WINDOW*, int, int, int, int, int, int, int);
837 int     curs_set (int);
838 int     def_prog_mode ();
839 int     def_shell_mode ();
840 int     delay_output (int);
841 int     delch ();
842 int     deleteln ();
843 void    delscreen (SCREEN*);
844 int     delwin (WINDOW*);
845 WINDOW* derwin (WINDOW*, int, int, int, int);
846 int     doupdate ();
847 WINDOW* dupwin (WINDOW*);
848 int     echochar (const chtype);
849 int     echo ();
850 int     endwin ();
851 char    erasechar ();
852 int     erase ();
853 void    filter ();
854 int     flash ();
855 int     flushinp ();
856 chtype  getbkgd (WINDOW*);
857 int     getnstr (char*, int);
858 int     getstr (char*);
859 WINDOW* getwin (FILE*);
860 int     halfdelay (int);
861 bool    has_colors ();
862 bool    has_ic ();
863 bool    has_il ();
864 int     hline (chtype, int);
865 void    idcok (WINDOW*, bool);
866 int     idlok (WINDOW*, bool);
867 void    immedok (WINDOW*, bool);
868 int     inchnstr (chtype*, int);
869 int     inchstr (chtype*);
870 chtype  inch ();
871 int     init_color (short, short, short, short);
872 int     init_pair (short, short, short);
873 WINDOW* initscr ();
874 int     innstr (char*, int);
875 int     insch (chtype);
876 int     insdelln (int);
877 int     insertln ();
878 int     insnstr (const(char)*, int);
879 int     insstr (const(char)*);
880 int     instr (char*);
881 int     intrflush (WINDOW*, bool);
882 bool    isendwin ();
883 bool    is_linetouched (WINDOW*, int);
884 bool    is_wintouched (WINDOW*);
885 char*   keyname (int);
886 int     keypad (WINDOW*, bool);
887 char    killchar ();
888 int     leaveok (WINDOW*, bool);
889 char*   longname ();
890 int     meta (WINDOW*, bool);
891 int     move (int, int);
892 int     mvaddch (int, int, const chtype);
893 int     mvaddchnstr (int, int, const(chtype)*, int);
894 int     mvaddchstr (int, int, const(chtype)*);
895 int     mvaddnstr (int, int, const(char)*, int);
896 int     mvaddstr (int, int, const(char)*);
897 int     mvchgat (int, int, int, attr_t, short, const(void)*);
898 int     mvcur (int, int, int, int);
899 int     mvdelch (int, int);
900 int     mvderwin (WINDOW*, int, int);
901 int     mvgetch (int, int);
902 int     mvgetnstr (int, int, char*, int);
903 int     mvgetstr (int, int, char*);
904 int     mvhline (int, int, chtype, int);
905 chtype  mvinch (int, int);
906 int     mvinchnstr (int, int, chtype*, int);
907 int     mvinchstr (int, int, chtype*);
908 int     mvinnstr (int, int, char*, int);
909 int     mvinsch (int, int, chtype);
910 int     mvinsnstr (int, int, const(char)*, int);
911 int     mvinsstr (int, int, const(char)*);
912 int     mvinstr (int, int, char*);
913 int     mvprintw (int, int, const(char)*, ...);
914 int     mvscanw (int, int, const(char)*, ...);
915 int     mvvline (int, int, chtype, int);
916 int     mvwaddchnstr (WINDOW*, int, int, const(chtype)*, int);
917 int     mvwaddchstr (WINDOW*, int, int, const(chtype)*);
918 int     mvwaddch (WINDOW*, int, int, const chtype);
919 int     mvwaddnstr (WINDOW*, int, int, const(char)*, int);
920 int     mvwaddstr (WINDOW*, int, int, const(char)*);
921 int     mvwchgat (WINDOW*, int, int, int, attr_t, short, const(void)*);
922 int     mvwdelch (WINDOW*, int, int);
923 int     mvwgetch (WINDOW*, int, int);
924 int     mvwgetnstr (WINDOW*, int, int, char*, int);
925 int     mvwgetstr (WINDOW*, int, int, char*);
926 int     mvwhline (WINDOW*, int, int, chtype, int);
927 int     mvwinchnstr (WINDOW*, int, int, chtype*, int);
928 int     mvwinchstr (WINDOW*, int, int, chtype*);
929 chtype  mvwinch (WINDOW*, int, int);
930 int     mvwinnstr (WINDOW*, int, int, char*, int);
931 int     mvwinsch (WINDOW*, int, int, chtype);
932 int     mvwinsnstr (WINDOW*, int, int, const(char)*, int);
933 int     mvwinsstr (WINDOW*, int, int, const(char)*);
934 int     mvwinstr (WINDOW*, int, int, char*);
935 int     mvwin (WINDOW*, int, int);
936 int     mvwprintw (WINDOW*, int, int, const(char)*, ...);
937 int     mvwscanw (WINDOW*, int, int, const(char)*, ...);
938 int     mvwvline (WINDOW*, int, int, chtype, int);
939 int     napms (int);
940 WINDOW* newpad (int, int);
941 SCREEN* newterm (const(char)*, FILE*, FILE*);
942 WINDOW* newwin (int, int, int, int);
943 int     nl ();
944 int     nocbreak ();
945 int     nodelay (WINDOW*, bool);
946 int     noecho ();
947 int     nonl ();
948 void    noqiflush ();
949 int     noraw ();
950 int     notimeout (WINDOW*, bool);
951 int     overlay (const(WINDOW)*, WINDOW*);
952 int     overwrite (const(WINDOW)*, WINDOW*);
953 int     pair_content (short, short*, short*);
954 int     pechochar (WINDOW*, chtype);
955 int     pnoutrefresh (WINDOW*, int, int, int, int, int, int);
956 int     prefresh (WINDOW*, int, int, int, int, int, int);
957 int     printw (const(char)*, ...);
958 int     putwin (WINDOW*, FILE*);
959 void    qiflush ();
960 int     raw ();
961 int     redrawwin (WINDOW*);
962 int     refresh ();
963 int     reset_prog_mode ();
964 int     reset_shell_mode ();
965 int     resetty ();
966 int     ripoffline (int, int function (WINDOW*, int));
967 int     savetty ();
968 int     scanw (const(char)*, ...);
969 int     scr_dump (const(char)*);
970 int     scr_init (const(char)*);
971 int     scr_restore (const(char)*);
972 int     scr_set (const(char)*);
973 int     scrl (int);
974 int     scroll (WINDOW*);
975 int     scrollok (WINDOW*, bool);
976 SCREEN* set_term (SCREEN*);
977 int     setscrreg (int, int);
978 int     slk_attroff (const chtype);
979 int     slk_attr_off (const attr_t, void*);
980 int     slk_attron (const chtype);
981 int     slk_attr_on (const attr_t, void*);
982 int     slk_attrset (const chtype);
983 int     slk_attr_set (const attr_t, short, void*);
984 int     slk_clear ();
985 int     slk_color (short);
986 int     slk_init (int);
987 char*   slk_label (int);
988 int     slk_noutrefresh ();
989 int     slk_refresh ();
990 int     slk_restore ();
991 int     slk_set (int, const(char)*, int);
992 int     slk_touch ();
993 int     standend ();
994 int     standout ();
995 int     start_color ();
996 WINDOW* subpad (WINDOW*, int, int, int, int);
997 WINDOW* subwin (WINDOW*, int, int, int, int);
998 int     syncok (WINDOW*, bool);
999 chtype  termattrs ();
1000 attr_t  term_attrs ();
1001 char*   termname ();
1002 void    timeout (int);
1003 int     touchline (WINDOW*, int, int);
1004 int     touchwin (WINDOW*);
1005 int     typeahead (int);
1006 int     untouchwin (WINDOW*);
1007 void    use_env (bool);
1008 int     vidattr (chtype);
1009 int     vid_attr (attr_t, short, void*);
1010 int     vidputs (chtype, int function (int));
1011 int     vid_puts (attr_t, short, void*, int function (int));
1012 int     vline (chtype, int);
1013 int     vw_printw (WINDOW*, const(char)*, va_list);
1014 int     vwprintw (WINDOW*, const(char)*, va_list);
1015 int     vw_scanw (WINDOW*, const(char)*, va_list);
1016 int     vwscanw (WINDOW*, const(char)*, va_list);
1017 int     waddchnstr (WINDOW*, const(chtype)*, int);
1018 int     waddchstr (WINDOW*, const(chtype)*);
1019 int     waddch (WINDOW*, const chtype);
1020 int     waddnstr (WINDOW*, const(char)*, int);
1021 int     waddstr (WINDOW*, const(char)*);
1022 int     wattroff (WINDOW*, chtype);
1023 int     wattron (WINDOW*, chtype);
1024 int     wattrset (WINDOW*, chtype);
1025 int     wattr_get (WINDOW*, attr_t*, short*, void*);
1026 int     wattr_off (WINDOW*, attr_t, void*);
1027 int     wattr_on (WINDOW*, attr_t, void*);
1028 int     wattr_set (WINDOW*, attr_t, short, void*);
1029 void    wbkgdset (WINDOW*, chtype);
1030 int     wbkgd (WINDOW*, chtype);
1031 int     wborder (WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
1032 int     wchgat (WINDOW*, int, attr_t, short, const(void)*);
1033 int     wclear (WINDOW*);
1034 int     wclrtobot (WINDOW*);
1035 int     wclrtoeol (WINDOW*);
1036 int     wcolor_set (WINDOW*, short, void*);
1037 void    wcursyncup (WINDOW*);
1038 int     wdelch (WINDOW*);
1039 int     wdeleteln (WINDOW*);
1040 int     wechochar (WINDOW*, const chtype);
1041 int     werase (WINDOW*);
1042 int     wgetch (WINDOW*);
1043 int     wgetnstr (WINDOW*, char*, int);
1044 int     wgetstr (WINDOW*, char*);
1045 int     whline (WINDOW*, chtype, int);
1046 int     winchnstr (WINDOW*, chtype*, int);
1047 int     winchstr (WINDOW*, chtype*);
1048 chtype  winch (WINDOW*);
1049 int     winnstr (WINDOW*, char*, int);
1050 int     winsch (WINDOW*, chtype);
1051 int     winsdelln (WINDOW*, int);
1052 int     winsertln (WINDOW*);
1053 int     winsnstr (WINDOW*, const(char)*, int);
1054 int     winsstr (WINDOW*, const(char)*);
1055 int     winstr (WINDOW*, char*);
1056 int     wmove (WINDOW*, int, int);
1057 int     wnoutrefresh (WINDOW*);
1058 int     wprintw (WINDOW*, const(char)*, ...);
1059 int     wredrawln (WINDOW*, int, int);
1060 int     wrefresh (WINDOW*);
1061 int     wscanw (WINDOW*, const(char)*, ...);
1062 int     wscrl (WINDOW*, int);
1063 int     wsetscrreg (WINDOW*, int, int);
1064 int     wstandend (WINDOW*);
1065 int     wstandout (WINDOW*);
1066 void    wsyncdown (WINDOW*);
1067 void    wsyncup (WINDOW*);
1068 void    wtimeout (WINDOW*, int);
1069 int     wtouchln (WINDOW*, int, int, int);
1070 int     wvline (WINDOW*, chtype, int);
1071 
1072 /* Quasi-standard */
1073 
1074 chtype getattrs (WINDOW*);
1075 int    getbegx (WINDOW*);
1076 int    getbegy (WINDOW*);
1077 int    getmaxx (WINDOW*);
1078 int    getmaxy (WINDOW*);
1079 int    getparx (WINDOW*);
1080 int    getpary (WINDOW*);
1081 int    getcurx (WINDOW*);
1082 int    getcury (WINDOW*);
1083 void   traceoff ();
1084 void   traceon ();
1085 char*  unctrl (chtype);
1086 
1087 int crmode ();
1088 int nocrmode ();
1089 int draino (int);
1090 int resetterm ();
1091 int fixterm ();
1092 int saveterm ();
1093 int setsyx (int, int);
1094 
1095 int     mouse_set (c_ulong);
1096 int     mouse_on (c_ulong);
1097 int     mouse_off (c_ulong);
1098 int     request_mouse_pos ();
1099 int     map_button (c_ulong);
1100 void    wmouse_position (WINDOW*, int*, int*);
1101 c_ulong getmouse ();
1102 c_ulong getbmap ();
1103 
1104 /* ncurses */
1105 
1106 int          assume_default_colors (int, int);
1107 const(char)* curses_version ();
1108 bool         has_key (int);
1109 int          use_default_colors ();
1110 int          wresize (WINDOW*, int, int);
1111 
1112 int     mouseinterval (int);
1113 mmask_t mousemask (mmask_t, mmask_t*);
1114 bool    mouse_trafo (int*, int*, bool);
1115 int     nc_getmouse (MEVENT*);
1116 int     ungetmouse (MEVENT*);
1117 bool    wenclose (const(WINDOW)*, int, int);
1118 bool    wmouse_trafo (const(WINDOW)*, int*, int*, bool);
1119 
1120 /* PDCurses */
1121 
1122 int     addrawch (chtype);
1123 int     insrawch (chtype);
1124 bool    is_termresized ();
1125 int     mvaddrawch (int, int, chtype);
1126 int     mvdeleteln (int, int);
1127 int     mvinsertln (int, int);
1128 int     mvinsrawch (int, int, chtype);
1129 int     mvwaddrawch (WINDOW*, int, int, chtype);
1130 int     mvwdeleteln (WINDOW*, int, int);
1131 int     mvwinsertln (WINDOW*, int, int);
1132 int     mvwinsrawch (WINDOW*, int, int, chtype);
1133 int     raw_output (bool);
1134 int     resize_term (int, int);
1135 WINDOW* resize_window (WINDOW*, int, int);
1136 int     waddrawch (WINDOW*, chtype);
1137 int     winsrawch (WINDOW*, chtype);
1138 char    wordchar ();
1139 
1140 void PDC_debug (const(char)*, ...);
1141 int  PDC_ungetch (int);
1142 int  PDC_set_blink (bool);
1143 int  PDC_set_line_color (short);
1144 void PDC_set_title (const(char)*);
1145 
1146 int PDC_clearclipboard ();
1147 int PDC_freeclipboard (char*);
1148 int PDC_getclipboard (char**, c_long*);
1149 int PDC_setclipboard (const(char)*, c_long);
1150 
1151 c_ulong PDC_get_input_fd ();
1152 c_ulong PDC_get_key_modifiers ();
1153 int     PDC_return_key_modifiers (bool);
1154 int     PDC_save_key_modifiers (bool);
1155 
1156 /*** Functions defined as macros ***/
1157 
1158 /* getch() and ungetch() conflict with some DOS libraries */
1159 
1160 extern (D) pragma (inline, true)
1161 auto getch()
1162 {
1163     return wgetch(stdscr);
1164 }
1165 
1166 alias ungetch = PDC_ungetch;
1167 
1168 extern (D) pragma (inline, true)
1169 auto COLOR_PAIR(T)(auto ref T n)
1170 {
1171     return (cast(chtype) n << PDC_COLOR_SHIFT) & A_COLOR;
1172 }
1173 
1174 extern (D) pragma (inline, true)
1175 auto PAIR_NUMBER(T)(auto ref T n)
1176 {
1177     return (n & A_COLOR) >> PDC_COLOR_SHIFT;
1178 }
1179 
1180 /* These will _only_ work as macros */
1181 
1182 /* return codes from PDC_getclipboard() and PDC_setclipboard() calls */
1183 
1184 enum PDC_CLIP_SUCCESS = 0;
1185 enum PDC_CLIP_ACCESS_ERROR = 1;
1186 enum PDC_CLIP_EMPTY = 2;
1187 enum PDC_CLIP_MEMORY_ERROR = 3;
1188 
1189 /* PDCurses key modifier masks */
1190 
1191 enum PDC_KEY_MODIFIER_SHIFT = 1;
1192 enum PDC_KEY_MODIFIER_CONTROL = 2;
1193 enum PDC_KEY_MODIFIER_ALT = 4;
1194 enum PDC_KEY_MODIFIER_NUMLOCK = 8;
1195 
1196 /* __PDCURSES__ */