aboutsummaryrefslogtreecommitdiff
path: root/scripts/kconfig/libcurses/curses.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scripts/kconfig/libcurses/curses.h1441
1 files changed, 1441 insertions, 0 deletions
diff --git a/scripts/kconfig/libcurses/curses.h b/scripts/kconfig/libcurses/curses.h
new file mode 100644
index 000000000..f58fe66df
--- /dev/null
+++ b/scripts/kconfig/libcurses/curses.h
@@ -0,0 +1,1441 @@
1/*----------------------------------------------------------------------*
2 * PDCurses *
3 *----------------------------------------------------------------------*/
4
5#ifndef __PDCURSES__
6#define __PDCURSES__ 1
7
8/*man-start**************************************************************
9
10Define before inclusion (only those needed):
11
12 Macro | Meaning / value
13 :-------------|-------------------------------------------------
14 XCURSES | if building / built for X11
15 PDC_RGB | RGB color (Red = 1, Green = 2, Blue = 4) vs. BGR
16 PDC_WIDE | if building / built with wide-character support
17 PDC_DLL_BUILD | if building / built as a Windows DLL
18 PDC_NCMOUSE | use ncurses mouse API vs. traditional PDCurses
19
20Defined by this header:
21
22 Macro | Meaning / value
23 :-------------|-------------------------------------------------
24 PDCURSES | PDCurses-only features are available
25 PDC_BUILD | API build version
26 PDC_VER_MAJOR | major version number
27 PDC_VER_MINOR | minor version number
28 PDC_VERDOT | version string
29
30**man-end****************************************************************/
31
32#define PDCURSES 1
33#define PDC_BUILD 3908
34#define PDC_VER_MAJOR 3
35#define PDC_VER_MINOR 9
36#define PDC_VERDOT "3.9"
37
38#define CHTYPE_LONG 1 /* chtype >= 32 bits */
39
40#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
41# define PDC_99 1
42#endif
43
44#if defined(__cplusplus) && __cplusplus >= 199711L
45# define PDC_PP98 1
46#endif
47
48/*----------------------------------------------------------------------*/
49
50#include <stdarg.h>
51#include <stddef.h>
52#include <stdio.h>
53
54#ifdef PDC_WIDE
55# include <wchar.h>
56#endif
57
58#if defined(PDC_99) && !defined(__bool_true_false_are_defined)
59# include <stdbool.h>
60#endif
61
62#ifdef __cplusplus
63extern "C"
64{
65# ifndef PDC_PP98
66# define bool _bool
67# endif
68#endif
69
70/*----------------------------------------------------------------------
71 *
72 * Constants and Types
73 *
74 */
75
76#undef FALSE
77#define FALSE 0
78
79#undef TRUE
80#define TRUE 1
81
82#undef ERR
83#define ERR (-1)
84
85#undef OK
86#define OK 0
87
88#if !defined(PDC_PP98) && !defined(__bool_true_false_are_defined)
89typedef unsigned char bool;
90#endif
91
92#if _LP64
93typedef unsigned int chtype;
94#else
95typedef unsigned long chtype; /* 16-bit attr + 16-bit char */
96#endif
97
98#ifdef PDC_WIDE
99typedef chtype cchar_t;
100#endif
101
102typedef chtype attr_t;
103
104/*----------------------------------------------------------------------
105 *
106 * Version Info
107 *
108 */
109
110/* Use this structure with PDC_get_version() for run-time info about the
111 way the library was built, in case it doesn't match the header. */
112
113typedef struct
114{
115 short flags; /* flags OR'd together (see below) */
116 short build; /* PDC_BUILD at compile time */
117 unsigned char major; /* PDC_VER_MAJOR */
118 unsigned char minor; /* PDC_VER_MINOR */
119 unsigned char csize; /* sizeof chtype */
120 unsigned char bsize; /* sizeof bool */
121} PDC_VERSION;
122
123enum
124{
125 PDC_VFLAG_DEBUG = 1, /* set if built with -DPDCDEBUG */
126 PDC_VFLAG_WIDE = 2, /* -DPDC_WIDE */
127 PDC_VFLAG_UTF8 = 4, /* -DPDC_FORCE_UTF8 */
128 PDC_VFLAG_DLL = 8, /* -DPDC_DLL_BUILD */
129 PDC_VFLAG_RGB = 16 /* -DPDC_RGB */
130};
131
132/*----------------------------------------------------------------------
133 *
134 * Mouse Interface
135 *
136 */
137
138#if _LP64
139typedef unsigned int mmask_t;
140#else
141typedef unsigned long mmask_t;
142#endif
143
144typedef struct
145{
146 int x; /* absolute column, 0 based, measured in characters */
147 int y; /* absolute row, 0 based, measured in characters */
148 short button[3]; /* state of each button */
149 int changes; /* flags indicating what has changed with the mouse */
150} MOUSE_STATUS;
151
152#define BUTTON_RELEASED 0x0000
153#define BUTTON_PRESSED 0x0001
154#define BUTTON_CLICKED 0x0002
155#define BUTTON_DOUBLE_CLICKED 0x0003
156#define BUTTON_TRIPLE_CLICKED 0x0004
157#define BUTTON_MOVED 0x0005 /* PDCurses */
158#define WHEEL_SCROLLED 0x0006 /* PDCurses */
159#define BUTTON_ACTION_MASK 0x0007 /* PDCurses */
160
161#define PDC_BUTTON_SHIFT 0x0008 /* PDCurses */
162#define PDC_BUTTON_CONTROL 0x0010 /* PDCurses */
163#define PDC_BUTTON_ALT 0x0020 /* PDCurses */
164#define BUTTON_MODIFIER_MASK 0x0038 /* PDCurses */
165
166#define MOUSE_X_POS (Mouse_status.x)
167#define MOUSE_Y_POS (Mouse_status.y)
168
169/*
170 * Bits associated with the .changes field:
171 * 3 2 1 0
172 * 210987654321098765432109876543210
173 * 1 <- button 1 has changed
174 * 10 <- button 2 has changed
175 * 100 <- button 3 has changed
176 * 1000 <- mouse has moved
177 * 10000 <- mouse position report
178 * 100000 <- mouse wheel up
179 * 1000000 <- mouse wheel down
180 * 10000000 <- mouse wheel left
181 * 100000000 <- mouse wheel right
182 */
183
184#define PDC_MOUSE_MOVED 0x0008
185#define PDC_MOUSE_POSITION 0x0010
186#define PDC_MOUSE_WHEEL_UP 0x0020
187#define PDC_MOUSE_WHEEL_DOWN 0x0040
188#define PDC_MOUSE_WHEEL_LEFT 0x0080
189#define PDC_MOUSE_WHEEL_RIGHT 0x0100
190
191#define A_BUTTON_CHANGED (Mouse_status.changes & 7)
192#define MOUSE_MOVED (Mouse_status.changes & PDC_MOUSE_MOVED)
193#define MOUSE_POS_REPORT (Mouse_status.changes & PDC_MOUSE_POSITION)
194#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1)))
195#define BUTTON_STATUS(x) (Mouse_status.button[(x) - 1])
196#define MOUSE_WHEEL_UP (Mouse_status.changes & PDC_MOUSE_WHEEL_UP)
197#define MOUSE_WHEEL_DOWN (Mouse_status.changes & PDC_MOUSE_WHEEL_DOWN)
198#define MOUSE_WHEEL_LEFT (Mouse_status.changes & PDC_MOUSE_WHEEL_LEFT)
199#define MOUSE_WHEEL_RIGHT (Mouse_status.changes & PDC_MOUSE_WHEEL_RIGHT)
200
201/* mouse bit-masks */
202
203#define BUTTON1_RELEASED 0x00000001L
204#define BUTTON1_PRESSED 0x00000002L
205#define BUTTON1_CLICKED 0x00000004L
206#define BUTTON1_DOUBLE_CLICKED 0x00000008L
207#define BUTTON1_TRIPLE_CLICKED 0x00000010L
208#define BUTTON1_MOVED 0x00000010L /* PDCurses */
209
210#define BUTTON2_RELEASED 0x00000020L
211#define BUTTON2_PRESSED 0x00000040L
212#define BUTTON2_CLICKED 0x00000080L
213#define BUTTON2_DOUBLE_CLICKED 0x00000100L
214#define BUTTON2_TRIPLE_CLICKED 0x00000200L
215#define BUTTON2_MOVED 0x00000200L /* PDCurses */
216
217#define BUTTON3_RELEASED 0x00000400L
218#define BUTTON3_PRESSED 0x00000800L
219#define BUTTON3_CLICKED 0x00001000L
220#define BUTTON3_DOUBLE_CLICKED 0x00002000L
221#define BUTTON3_TRIPLE_CLICKED 0x00004000L
222#define BUTTON3_MOVED 0x00004000L /* PDCurses */
223
224/* For the ncurses-compatible functions only, BUTTON4_PRESSED and
225 BUTTON5_PRESSED are returned for mouse scroll wheel up and down;
226 otherwise PDCurses doesn't support buttons 4 and 5 */
227
228#define BUTTON4_RELEASED 0x00008000L
229#define BUTTON4_PRESSED 0x00010000L
230#define BUTTON4_CLICKED 0x00020000L
231#define BUTTON4_DOUBLE_CLICKED 0x00040000L
232#define BUTTON4_TRIPLE_CLICKED 0x00080000L
233
234#define BUTTON5_RELEASED 0x00100000L
235#define BUTTON5_PRESSED 0x00200000L
236#define BUTTON5_CLICKED 0x00400000L
237#define BUTTON5_DOUBLE_CLICKED 0x00800000L
238#define BUTTON5_TRIPLE_CLICKED 0x01000000L
239
240#define MOUSE_WHEEL_SCROLL 0x02000000L /* PDCurses */
241#define BUTTON_MODIFIER_SHIFT 0x04000000L /* PDCurses */
242#define BUTTON_MODIFIER_CONTROL 0x08000000L /* PDCurses */
243#define BUTTON_MODIFIER_ALT 0x10000000L /* PDCurses */
244
245#define ALL_MOUSE_EVENTS 0x1fffffffL
246#define REPORT_MOUSE_POSITION 0x20000000L
247
248/* ncurses mouse interface */
249
250typedef struct
251{
252 short id; /* unused, always 0 */
253 int x, y, z; /* x, y same as MOUSE_STATUS; z unused */
254 mmask_t bstate; /* equivalent to changes + button[], but
255 in the same format as used for mousemask() */
256} MEVENT;
257
258#if defined(PDC_NCMOUSE) && !defined(NCURSES_MOUSE_VERSION)
259# define NCURSES_MOUSE_VERSION 2
260#endif
261
262#ifdef NCURSES_MOUSE_VERSION
263# define BUTTON_SHIFT BUTTON_MODIFIER_SHIFT
264# define BUTTON_CONTROL BUTTON_MODIFIER_CONTROL
265# define BUTTON_CTRL BUTTON_MODIFIER_CONTROL
266# define BUTTON_ALT BUTTON_MODIFIER_ALT
267#else
268# define BUTTON_SHIFT PDC_BUTTON_SHIFT
269# define BUTTON_CONTROL PDC_BUTTON_CONTROL
270# define BUTTON_ALT PDC_BUTTON_ALT
271#endif
272
273/*----------------------------------------------------------------------
274 *
275 * Window and Screen Structures
276 *
277 */
278
279typedef struct _win /* definition of a window */
280{
281 int _cury; /* current pseudo-cursor */
282 int _curx;
283 int _maxy; /* max window coordinates */
284 int _maxx;
285 int _begy; /* origin on screen */
286 int _begx;
287 int _flags; /* window properties */
288 chtype _attrs; /* standard attributes and colors */
289 chtype _bkgd; /* background, normally blank */
290 bool _clear; /* causes clear at next refresh */
291 bool _leaveit; /* leaves cursor where it is */
292 bool _scroll; /* allows window scrolling */
293 bool _nodelay; /* input character wait flag */
294 bool _immed; /* immediate update flag */
295 bool _sync; /* synchronise window ancestors */
296 bool _use_keypad; /* flags keypad key mode active */
297 chtype **_y; /* pointer to line pointer array */
298 int *_firstch; /* first changed character in line */
299 int *_lastch; /* last changed character in line */
300 int _tmarg; /* top of scrolling region */
301 int _bmarg; /* bottom of scrolling region */
302 int _delayms; /* milliseconds of delay for getch() */
303 int _parx, _pary; /* coords relative to parent (0,0) */
304 struct _win *_parent; /* subwin's pointer to parent win */
305
306 /* these are used only if this is a pad */
307 struct pdat
308 {
309 int _pad_y;
310 int _pad_x;
311 int _pad_top;
312 int _pad_left;
313 int _pad_bottom;
314 int _pad_right;
315 } _pad; /* Pad-properties structure */
316} WINDOW;
317
318/* Color pair structure */
319
320typedef struct
321{
322 short f; /* foreground color */
323 short b; /* background color */
324 int count; /* allocation order */
325 bool set; /* pair has been set */
326} PDC_PAIR;
327
328/* Avoid using the SCREEN struct directly -- use the corresponding
329 functions if possible. This struct may eventually be made private. */
330
331typedef struct
332{
333 bool alive; /* if initscr() called, and not endwin() */
334 bool autocr; /* if cr -> lf */
335 bool cbreak; /* if terminal unbuffered */
336 bool echo; /* if terminal echo */
337 bool raw_inp; /* raw input mode (v. cooked input) */
338 bool raw_out; /* raw output mode (7 v. 8 bits) */
339 bool audible; /* FALSE if the bell is visual */
340 bool mono; /* TRUE if current screen is mono */
341 bool resized; /* TRUE if TERM has been resized */
342 bool orig_attr; /* TRUE if we have the original colors */
343 short orig_fore; /* original screen foreground color */
344 short orig_back; /* original screen foreground color */
345 int cursrow; /* position of physical cursor */
346 int curscol; /* position of physical cursor */
347 int visibility; /* visibility of cursor */
348 int orig_cursor; /* original cursor size */
349 int lines; /* new value for LINES */
350 int cols; /* new value for COLS */
351 mmask_t _trap_mbe; /* trap these mouse button events */
352 int mouse_wait; /* time to wait (in ms) for a
353 button release after a press, in
354 order to count it as a click */
355 int slklines; /* lines in use by slk_init() */
356 WINDOW *slk_winptr; /* window for slk */
357 int linesrippedoff; /* lines ripped off via ripoffline() */
358 int linesrippedoffontop; /* lines ripped off on
359 top via ripoffline() */
360 int delaytenths; /* 1/10ths second to wait block
361 getch() for */
362 bool _preserve; /* TRUE if screen background
363 to be preserved */
364 int _restore; /* specifies if screen background
365 to be restored, and how */
366 unsigned long key_modifiers; /* key modifiers (SHIFT, CONTROL, etc.)
367 on last key press */
368 bool return_key_modifiers; /* TRUE if modifier keys are
369 returned as "real" keys */
370 bool key_code; /* TRUE if last key is a special key;
371 used internally by get_wch() */
372 MOUSE_STATUS mouse_status; /* last returned mouse status */
373 short line_color; /* color of line attributes - default -1 */
374 attr_t termattrs; /* attribute capabilities */
375 WINDOW *lastscr; /* the last screen image */
376 FILE *dbfp; /* debug trace file pointer */
377 bool color_started; /* TRUE after start_color() */
378 bool dirty; /* redraw on napms() after init_color() */
379 int sel_start; /* start of selection (y * COLS + x) */
380 int sel_end; /* end of selection */
381 int *c_buffer; /* character buffer */
382 int c_pindex; /* putter index */
383 int c_gindex; /* getter index */
384 int *c_ungch; /* array of ungotten chars */
385 int c_ungind; /* ungetch() push index */
386 int c_ungmax; /* allocated size of ungetch() buffer */
387 PDC_PAIR *atrtab; /* table of color pairs */
388} SCREEN;
389
390/*----------------------------------------------------------------------
391 *
392 * External Variables
393 *
394 */
395
396#ifdef PDC_DLL_BUILD
397# ifdef CURSES_LIBRARY
398# define PDCEX __declspec(dllexport) extern
399# else
400# define PDCEX __declspec(dllimport)
401# endif
402#else
403# define PDCEX extern
404#endif
405
406PDCEX int LINES; /* terminal height */
407PDCEX int COLS; /* terminal width */
408PDCEX WINDOW *stdscr; /* the default screen window */
409PDCEX WINDOW *curscr; /* the current screen image */
410PDCEX SCREEN *SP; /* curses variables */
411PDCEX MOUSE_STATUS Mouse_status;
412PDCEX int COLORS;
413PDCEX int COLOR_PAIRS;
414PDCEX int TABSIZE;
415PDCEX chtype acs_map[]; /* alternate character set map */
416PDCEX char ttytype[]; /* terminal name/description */
417
418/*man-start**************************************************************
419
420Text Attributes
421===============
422
423PDCurses uses a 32-bit integer for its chtype:
424
425 color pair | modifiers | character eg 'a'
426 -----------------------|-----------------------|--------------------
427 31 30 29 28 27 26 25 24|23 22 21 20 19 18 17 16|15 14 13 .. 2 1 0
428
429There are 256 color pairs (8 bits), 8 bits for modifiers, and 16 bits
430for character data. The modifiers are bold, underline, right-line,
431left-line, italic, reverse and blink, plus the alternate character set
432indicator.
433
434**man-end****************************************************************/
435
436/*** Video attribute macros ***/
437
438#define A_NORMAL (chtype)0
439
440#define A_ALTCHARSET (chtype)0x00010000
441#define A_RIGHT (chtype)0x00020000
442#define A_LEFT (chtype)0x00040000
443#define A_ITALIC (chtype)0x00080000
444#define A_UNDERLINE (chtype)0x00100000
445#define A_REVERSE (chtype)0x00200000
446#define A_BLINK (chtype)0x00400000
447#define A_BOLD (chtype)0x00800000
448
449#define A_ATTRIBUTES (chtype)0xffff0000
450#define A_CHARTEXT (chtype)0x0000ffff
451#define A_COLOR (chtype)0xff000000
452
453#define PDC_COLOR_SHIFT 24
454
455#define A_LEFTLINE A_LEFT
456#define A_RIGHTLINE A_RIGHT
457#define A_STANDOUT (A_REVERSE | A_BOLD) /* X/Open */
458
459#define A_DIM A_NORMAL
460#define A_INVIS A_NORMAL
461#define A_PROTECT A_NORMAL
462
463#define A_HORIZONTAL A_NORMAL
464#define A_LOW A_NORMAL
465#define A_TOP A_NORMAL
466#define A_VERTICAL A_NORMAL
467
468#define CHR_MSK A_CHARTEXT /* Obsolete */
469#define ATR_MSK A_ATTRIBUTES /* Obsolete */
470#define ATR_NRM A_NORMAL /* Obsolete */
471
472/* For use with attr_t -- X/Open says, "these shall be distinct", so
473 this is a non-conforming implementation. */
474
475#define WA_NORMAL A_NORMAL
476
477#define WA_ALTCHARSET A_ALTCHARSET
478#define WA_BLINK A_BLINK
479#define WA_BOLD A_BOLD
480#define WA_DIM A_DIM
481#define WA_INVIS A_INVIS
482#define WA_ITALIC A_ITALIC
483#define WA_LEFT A_LEFT
484#define WA_PROTECT A_PROTECT
485#define WA_REVERSE A_REVERSE
486#define WA_RIGHT A_RIGHT
487#define WA_STANDOUT A_STANDOUT
488#define WA_UNDERLINE A_UNDERLINE
489
490#define WA_HORIZONTAL A_HORIZONTAL
491#define WA_LOW A_LOW
492#define WA_TOP A_TOP
493#define WA_VERTICAL A_VERTICAL
494
495#define WA_ATTRIBUTES A_ATTRIBUTES
496
497/*** Alternate character set macros ***/
498
499#define PDC_ACS(w) ((chtype)w | A_ALTCHARSET)
500
501/* VT100-compatible symbols -- box chars */
502
503#define ACS_ULCORNER PDC_ACS('l')
504#define ACS_LLCORNER PDC_ACS('m')
505#define ACS_URCORNER PDC_ACS('k')
506#define ACS_LRCORNER PDC_ACS('j')
507#define ACS_RTEE PDC_ACS('u')
508#define ACS_LTEE PDC_ACS('t')
509#define ACS_BTEE PDC_ACS('v')
510#define ACS_TTEE PDC_ACS('w')
511#define ACS_HLINE PDC_ACS('q')
512#define ACS_VLINE PDC_ACS('x')
513#define ACS_PLUS PDC_ACS('n')
514
515/* VT100-compatible symbols -- other */
516
517#define ACS_S1 PDC_ACS('o')
518#define ACS_S9 PDC_ACS('s')
519#define ACS_DIAMOND PDC_ACS('`')
520#define ACS_CKBOARD PDC_ACS('a')
521#define ACS_DEGREE PDC_ACS('f')
522#define ACS_PLMINUS PDC_ACS('g')
523#define ACS_BULLET PDC_ACS('~')
524
525/* Teletype 5410v1 symbols -- these are defined in SysV curses, but
526 are not well-supported by most terminals. Stick to VT100 characters
527 for optimum portability. */
528
529#define ACS_LARROW PDC_ACS(',')
530#define ACS_RARROW PDC_ACS('+')
531#define ACS_DARROW PDC_ACS('.')
532#define ACS_UARROW PDC_ACS('-')
533#define ACS_BOARD PDC_ACS('h')
534#define ACS_LANTERN PDC_ACS('i')
535#define ACS_BLOCK PDC_ACS('0')
536
537/* That goes double for these -- undocumented SysV symbols. Don't use
538 them. */
539
540#define ACS_S3 PDC_ACS('p')
541#define ACS_S7 PDC_ACS('r')
542#define ACS_LEQUAL PDC_ACS('y')
543#define ACS_GEQUAL PDC_ACS('z')
544#define ACS_PI PDC_ACS('{')
545#define ACS_NEQUAL PDC_ACS('|')
546#define ACS_STERLING PDC_ACS('}')
547
548/* Box char aliases */
549
550#define ACS_BSSB ACS_ULCORNER
551#define ACS_SSBB ACS_LLCORNER
552#define ACS_BBSS ACS_URCORNER
553#define ACS_SBBS ACS_LRCORNER
554#define ACS_SBSS ACS_RTEE
555#define ACS_SSSB ACS_LTEE
556#define ACS_SSBS ACS_BTEE
557#define ACS_BSSS ACS_TTEE
558#define ACS_BSBS ACS_HLINE
559#define ACS_SBSB ACS_VLINE
560#define ACS_SSSS ACS_PLUS
561
562/* cchar_t aliases */
563
564#ifdef PDC_WIDE
565# define WACS_ULCORNER (&(acs_map['l']))
566# define WACS_LLCORNER (&(acs_map['m']))
567# define WACS_URCORNER (&(acs_map['k']))
568# define WACS_LRCORNER (&(acs_map['j']))
569# define WACS_RTEE (&(acs_map['u']))
570# define WACS_LTEE (&(acs_map['t']))
571# define WACS_BTEE (&(acs_map['v']))
572# define WACS_TTEE (&(acs_map['w']))
573# define WACS_HLINE (&(acs_map['q']))
574# define WACS_VLINE (&(acs_map['x']))
575# define WACS_PLUS (&(acs_map['n']))
576
577# define WACS_S1 (&(acs_map['o']))
578# define WACS_S9 (&(acs_map['s']))
579# define WACS_DIAMOND (&(acs_map['`']))
580# define WACS_CKBOARD (&(acs_map['a']))
581# define WACS_DEGREE (&(acs_map['f']))
582# define WACS_PLMINUS (&(acs_map['g']))
583# define WACS_BULLET (&(acs_map['~']))
584
585# define WACS_LARROW (&(acs_map[',']))
586# define WACS_RARROW (&(acs_map['+']))
587# define WACS_DARROW (&(acs_map['.']))
588# define WACS_UARROW (&(acs_map['-']))
589# define WACS_BOARD (&(acs_map['h']))
590# define WACS_LANTERN (&(acs_map['i']))
591# define WACS_BLOCK (&(acs_map['0']))
592
593# define WACS_S3 (&(acs_map['p']))
594# define WACS_S7 (&(acs_map['r']))
595# define WACS_LEQUAL (&(acs_map['y']))
596# define WACS_GEQUAL (&(acs_map['z']))
597# define WACS_PI (&(acs_map['{']))
598# define WACS_NEQUAL (&(acs_map['|']))
599# define WACS_STERLING (&(acs_map['}']))
600
601# define WACS_BSSB WACS_ULCORNER
602# define WACS_SSBB WACS_LLCORNER
603# define WACS_BBSS WACS_URCORNER
604# define WACS_SBBS WACS_LRCORNER
605# define WACS_SBSS WACS_RTEE
606# define WACS_SSSB WACS_LTEE
607# define WACS_SSBS WACS_BTEE
608# define WACS_BSSS WACS_TTEE
609# define WACS_BSBS WACS_HLINE
610# define WACS_SBSB WACS_VLINE
611# define WACS_SSSS WACS_PLUS
612#endif
613
614/*** Color macros ***/
615
616#define COLOR_BLACK 0
617
618#ifdef PDC_RGB /* RGB */
619# define COLOR_RED 1
620# define COLOR_GREEN 2
621# define COLOR_BLUE 4
622#else /* BGR */
623# define COLOR_BLUE 1
624# define COLOR_GREEN 2
625# define COLOR_RED 4
626#endif
627
628#define COLOR_CYAN (COLOR_BLUE | COLOR_GREEN)
629#define COLOR_MAGENTA (COLOR_RED | COLOR_BLUE)
630#define COLOR_YELLOW (COLOR_RED | COLOR_GREEN)
631
632#define COLOR_WHITE 7
633
634/*----------------------------------------------------------------------
635 *
636 * Function and Keypad Key Definitions
637 * Many are just for compatibility
638 *
639 */
640
641#define KEY_CODE_YES 0x100 /* If get_wch() gives a key code */
642
643#define KEY_BREAK 0x101 /* Not on PC KBD */
644#define KEY_DOWN 0x102 /* Down arrow key */
645#define KEY_UP 0x103 /* Up arrow key */
646#define KEY_LEFT 0x104 /* Left arrow key */
647#define KEY_RIGHT 0x105 /* Right arrow key */
648#define KEY_HOME 0x106 /* home key */
649#define KEY_BACKSPACE 0x107 /* not on pc */
650#define KEY_F0 0x108 /* function keys; 64 reserved */
651
652#define KEY_DL 0x148 /* delete line */
653#define KEY_IL 0x149 /* insert line */
654#define KEY_DC 0x14a /* delete character */
655#define KEY_IC 0x14b /* insert char or enter ins mode */
656#define KEY_EIC 0x14c /* exit insert char mode */
657#define KEY_CLEAR 0x14d /* clear screen */
658#define KEY_EOS 0x14e /* clear to end of screen */
659#define KEY_EOL 0x14f /* clear to end of line */
660#define KEY_SF 0x150 /* scroll 1 line forward */
661#define KEY_SR 0x151 /* scroll 1 line back (reverse) */
662#define KEY_NPAGE 0x152 /* next page */
663#define KEY_PPAGE 0x153 /* previous page */
664#define KEY_STAB 0x154 /* set tab */
665#define KEY_CTAB 0x155 /* clear tab */
666#define KEY_CATAB 0x156 /* clear all tabs */
667#define KEY_ENTER 0x157 /* enter or send (unreliable) */
668#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable) */
669#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */
670#define KEY_PRINT 0x15a /* print/copy */
671#define KEY_LL 0x15b /* home down/bottom (lower left) */
672#define KEY_ABORT 0x15c /* abort/terminate key (any) */
673#define KEY_SHELP 0x15d /* short help */
674#define KEY_LHELP 0x15e /* long help */
675#define KEY_BTAB 0x15f /* Back tab key */
676#define KEY_BEG 0x160 /* beg(inning) key */
677#define KEY_CANCEL 0x161 /* cancel key */
678#define KEY_CLOSE 0x162 /* close key */
679#define KEY_COMMAND 0x163 /* cmd (command) key */
680#define KEY_COPY 0x164 /* copy key */
681#define KEY_CREATE 0x165 /* create key */
682#define KEY_END 0x166 /* end key */
683#define KEY_EXIT 0x167 /* exit key */
684#define KEY_FIND 0x168 /* find key */
685#define KEY_HELP 0x169 /* help key */
686#define KEY_MARK 0x16a /* mark key */
687#define KEY_MESSAGE 0x16b /* message key */
688#define KEY_MOVE 0x16c /* move key */
689#define KEY_NEXT 0x16d /* next object key */
690#define KEY_OPEN 0x16e /* open key */
691#define KEY_OPTIONS 0x16f /* options key */
692#define KEY_PREVIOUS 0x170 /* previous object key */
693#define KEY_REDO 0x171 /* redo key */
694#define KEY_REFERENCE 0x172 /* ref(erence) key */
695#define KEY_REFRESH 0x173 /* refresh key */
696#define KEY_REPLACE 0x174 /* replace key */
697#define KEY_RESTART 0x175 /* restart key */
698#define KEY_RESUME 0x176 /* resume key */
699#define KEY_SAVE 0x177 /* save key */
700#define KEY_SBEG 0x178 /* shifted beginning key */
701#define KEY_SCANCEL 0x179 /* shifted cancel key */
702#define KEY_SCOMMAND 0x17a /* shifted command key */
703#define KEY_SCOPY 0x17b /* shifted copy key */
704#define KEY_SCREATE 0x17c /* shifted create key */
705#define KEY_SDC 0x17d /* shifted delete char key */
706#define KEY_SDL 0x17e /* shifted delete line key */
707#define KEY_SELECT 0x17f /* select key */
708#define KEY_SEND 0x180 /* shifted end key */
709#define KEY_SEOL 0x181 /* shifted clear line key */
710#define KEY_SEXIT 0x182 /* shifted exit key */
711#define KEY_SFIND 0x183 /* shifted find key */
712#define KEY_SHOME 0x184 /* shifted home key */
713#define KEY_SIC 0x185 /* shifted input key */
714
715#define KEY_SLEFT 0x187 /* shifted left arrow key */
716#define KEY_SMESSAGE 0x188 /* shifted message key */
717#define KEY_SMOVE 0x189 /* shifted move key */
718#define KEY_SNEXT 0x18a /* shifted next key */
719#define KEY_SOPTIONS 0x18b /* shifted options key */
720#define KEY_SPREVIOUS 0x18c /* shifted prev key */
721#define KEY_SPRINT 0x18d /* shifted print key */
722#define KEY_SREDO 0x18e /* shifted redo key */
723#define KEY_SREPLACE 0x18f /* shifted replace key */
724#define KEY_SRIGHT 0x190 /* shifted right arrow */
725#define KEY_SRSUME 0x191 /* shifted resume key */
726#define KEY_SSAVE 0x192 /* shifted save key */
727#define KEY_SSUSPEND 0x193 /* shifted suspend key */
728#define KEY_SUNDO 0x194 /* shifted undo key */
729#define KEY_SUSPEND 0x195 /* suspend key */
730#define KEY_UNDO 0x196 /* undo key */
731
732/* PDCurses-specific key definitions -- PC only */
733
734#define ALT_0 0x197
735#define ALT_1 0x198
736#define ALT_2 0x199
737#define ALT_3 0x19a
738#define ALT_4 0x19b
739#define ALT_5 0x19c
740#define ALT_6 0x19d
741#define ALT_7 0x19e
742#define ALT_8 0x19f
743#define ALT_9 0x1a0
744#define ALT_A 0x1a1
745#define ALT_B 0x1a2
746#define ALT_C 0x1a3
747#define ALT_D 0x1a4
748#define ALT_E 0x1a5
749#define ALT_F 0x1a6
750#define ALT_G 0x1a7
751#define ALT_H 0x1a8
752#define ALT_I 0x1a9
753#define ALT_J 0x1aa
754#define ALT_K 0x1ab
755#define ALT_L 0x1ac
756#define ALT_M 0x1ad
757#define ALT_N 0x1ae
758#define ALT_O 0x1af
759#define ALT_P 0x1b0
760#define ALT_Q 0x1b1
761#define ALT_R 0x1b2
762#define ALT_S 0x1b3
763#define ALT_T 0x1b4
764#define ALT_U 0x1b5
765#define ALT_V 0x1b6
766#define ALT_W 0x1b7
767#define ALT_X 0x1b8
768#define ALT_Y 0x1b9
769#define ALT_Z 0x1ba
770
771#define CTL_LEFT 0x1bb /* Control-Left-Arrow */
772#define CTL_RIGHT 0x1bc
773#define CTL_PGUP 0x1bd
774#define CTL_PGDN 0x1be
775#define CTL_HOME 0x1bf
776#define CTL_END 0x1c0
777
778#define KEY_A1 0x1c1 /* upper left on Virtual keypad */
779#define KEY_A2 0x1c2 /* upper middle on Virt. keypad */
780#define KEY_A3 0x1c3 /* upper right on Vir. keypad */
781#define KEY_B1 0x1c4 /* middle left on Virt. keypad */
782#define KEY_B2 0x1c5 /* center on Virt. keypad */
783#define KEY_B3 0x1c6 /* middle right on Vir. keypad */
784#define KEY_C1 0x1c7 /* lower left on Virt. keypad */
785#define KEY_C2 0x1c8 /* lower middle on Virt. keypad */
786#define KEY_C3 0x1c9 /* lower right on Vir. keypad */
787
788#define PADSLASH 0x1ca /* slash on keypad */
789#define PADENTER 0x1cb /* enter on keypad */
790#define CTL_PADENTER 0x1cc /* ctl-enter on keypad */
791#define ALT_PADENTER 0x1cd /* alt-enter on keypad */
792#define PADSTOP 0x1ce /* stop on keypad */
793#define PADSTAR 0x1cf /* star on keypad */
794#define PADMINUS 0x1d0 /* minus on keypad */
795#define PADPLUS 0x1d1 /* plus on keypad */
796#define CTL_PADSTOP 0x1d2 /* ctl-stop on keypad */
797#define CTL_PADCENTER 0x1d3 /* ctl-enter on keypad */
798#define CTL_PADPLUS 0x1d4 /* ctl-plus on keypad */
799#define CTL_PADMINUS 0x1d5 /* ctl-minus on keypad */
800#define CTL_PADSLASH 0x1d6 /* ctl-slash on keypad */
801#define CTL_PADSTAR 0x1d7 /* ctl-star on keypad */
802#define ALT_PADPLUS 0x1d8 /* alt-plus on keypad */
803#define ALT_PADMINUS 0x1d9 /* alt-minus on keypad */
804#define ALT_PADSLASH 0x1da /* alt-slash on keypad */
805#define ALT_PADSTAR 0x1db /* alt-star on keypad */
806#define ALT_PADSTOP 0x1dc /* alt-stop on keypad */
807#define CTL_INS 0x1dd /* ctl-insert */
808#define ALT_DEL 0x1de /* alt-delete */
809#define ALT_INS 0x1df /* alt-insert */
810#define CTL_UP 0x1e0 /* ctl-up arrow */
811#define CTL_DOWN 0x1e1 /* ctl-down arrow */
812#define CTL_TAB 0x1e2 /* ctl-tab */
813#define ALT_TAB 0x1e3
814#define ALT_MINUS 0x1e4
815#define ALT_EQUAL 0x1e5
816#define ALT_HOME 0x1e6
817#define ALT_PGUP 0x1e7
818#define ALT_PGDN 0x1e8
819#define ALT_END 0x1e9
820#define ALT_UP 0x1ea /* alt-up arrow */
821#define ALT_DOWN 0x1eb /* alt-down arrow */
822#define ALT_RIGHT 0x1ec /* alt-right arrow */
823#define ALT_LEFT 0x1ed /* alt-left arrow */
824#define ALT_ENTER 0x1ee /* alt-enter */
825#define ALT_ESC 0x1ef /* alt-escape */
826#define ALT_BQUOTE 0x1f0 /* alt-back quote */
827#define ALT_LBRACKET 0x1f1 /* alt-left bracket */
828#define ALT_RBRACKET 0x1f2 /* alt-right bracket */
829#define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */
830#define ALT_FQUOTE 0x1f4 /* alt-forward quote */
831#define ALT_COMMA 0x1f5 /* alt-comma */
832#define ALT_STOP 0x1f6 /* alt-stop */
833#define ALT_FSLASH 0x1f7 /* alt-forward slash */
834#define ALT_BKSP 0x1f8 /* alt-backspace */
835#define CTL_BKSP 0x1f9 /* ctl-backspace */
836#define PAD0 0x1fa /* keypad 0 */
837
838#define CTL_PAD0 0x1fb /* ctl-keypad 0 */
839#define CTL_PAD1 0x1fc
840#define CTL_PAD2 0x1fd
841#define CTL_PAD3 0x1fe
842#define CTL_PAD4 0x1ff
843#define CTL_PAD5 0x200
844#define CTL_PAD6 0x201
845#define CTL_PAD7 0x202
846#define CTL_PAD8 0x203
847#define CTL_PAD9 0x204
848
849#define ALT_PAD0 0x205 /* alt-keypad 0 */
850#define ALT_PAD1 0x206
851#define ALT_PAD2 0x207
852#define ALT_PAD3 0x208
853#define ALT_PAD4 0x209
854#define ALT_PAD5 0x20a
855#define ALT_PAD6 0x20b
856#define ALT_PAD7 0x20c
857#define ALT_PAD8 0x20d
858#define ALT_PAD9 0x20e
859
860#define CTL_DEL 0x20f /* clt-delete */
861#define ALT_BSLASH 0x210 /* alt-back slash */
862#define CTL_ENTER 0x211 /* ctl-enter */
863
864#define SHF_PADENTER 0x212 /* shift-enter on keypad */
865#define SHF_PADSLASH 0x213 /* shift-slash on keypad */
866#define SHF_PADSTAR 0x214 /* shift-star on keypad */
867#define SHF_PADPLUS 0x215 /* shift-plus on keypad */
868#define SHF_PADMINUS 0x216 /* shift-minus on keypad */
869#define SHF_UP 0x217 /* shift-up on keypad */
870#define SHF_DOWN 0x218 /* shift-down on keypad */
871#define SHF_IC 0x219 /* shift-insert on keypad */
872#define SHF_DC 0x21a /* shift-delete on keypad */
873
874#define KEY_MOUSE 0x21b /* "mouse" key */
875#define KEY_SHIFT_L 0x21c /* Left-shift */
876#define KEY_SHIFT_R 0x21d /* Right-shift */
877#define KEY_CONTROL_L 0x21e /* Left-control */
878#define KEY_CONTROL_R 0x21f /* Right-control */
879#define KEY_ALT_L 0x220 /* Left-alt */
880#define KEY_ALT_R 0x221 /* Right-alt */
881#define KEY_RESIZE 0x222 /* Window resize */
882#define KEY_SUP 0x223 /* Shifted up arrow */
883#define KEY_SDOWN 0x224 /* Shifted down arrow */
884
885#define KEY_MIN KEY_BREAK /* Minimum curses key value */
886#define KEY_MAX KEY_SDOWN /* Maximum curses key */
887
888#define KEY_F(n) (KEY_F0 + (n))
889
890/*----------------------------------------------------------------------
891 *
892 * Functions
893 *
894 */
895
896/* Standard */
897
898PDCEX int addch(const chtype);
899PDCEX int addchnstr(const chtype *, int);
900PDCEX int addchstr(const chtype *);
901PDCEX int addnstr(const char *, int);
902PDCEX int addstr(const char *);
903PDCEX int attroff(chtype);
904PDCEX int attron(chtype);
905PDCEX int attrset(chtype);
906PDCEX int attr_get(attr_t *, short *, void *);
907PDCEX int attr_off(attr_t, void *);
908PDCEX int attr_on(attr_t, void *);
909PDCEX int attr_set(attr_t, short, void *);
910PDCEX int baudrate(void);
911PDCEX int beep(void);
912PDCEX int bkgd(chtype);
913PDCEX void bkgdset(chtype);
914PDCEX int border(chtype, chtype, chtype, chtype,
915 chtype, chtype, chtype, chtype);
916PDCEX int box(WINDOW *, chtype, chtype);
917PDCEX bool can_change_color(void);
918PDCEX int cbreak(void);
919PDCEX int chgat(int, attr_t, short, const void *);
920PDCEX int clearok(WINDOW *, bool);
921PDCEX int clear(void);
922PDCEX int clrtobot(void);
923PDCEX int clrtoeol(void);
924PDCEX int color_content(short, short *, short *, short *);
925PDCEX int color_set(short, void *);
926PDCEX int copywin(const WINDOW *, WINDOW *, int, int, int,
927 int, int, int, int);
928PDCEX int curs_set(int);
929PDCEX int def_prog_mode(void);
930PDCEX int def_shell_mode(void);
931PDCEX int delay_output(int);
932PDCEX int delch(void);
933PDCEX int deleteln(void);
934PDCEX void delscreen(SCREEN *);
935PDCEX int delwin(WINDOW *);
936PDCEX WINDOW *derwin(WINDOW *, int, int, int, int);
937PDCEX int doupdate(void);
938PDCEX WINDOW *dupwin(WINDOW *);
939PDCEX int echochar(const chtype);
940PDCEX int echo(void);
941PDCEX int endwin(void);
942PDCEX char erasechar(void);
943PDCEX int erase(void);
944PDCEX void filter(void);
945PDCEX int flash(void);
946PDCEX int flushinp(void);
947PDCEX chtype getbkgd(WINDOW *);
948PDCEX int getnstr(char *, int);
949PDCEX int getstr(char *);
950PDCEX WINDOW *getwin(FILE *);
951PDCEX int halfdelay(int);
952PDCEX bool has_colors(void);
953PDCEX bool has_ic(void);
954PDCEX bool has_il(void);
955PDCEX int hline(chtype, int);
956PDCEX void idcok(WINDOW *, bool);
957PDCEX int idlok(WINDOW *, bool);
958PDCEX void immedok(WINDOW *, bool);
959PDCEX int inchnstr(chtype *, int);
960PDCEX int inchstr(chtype *);
961PDCEX chtype inch(void);
962PDCEX int init_color(short, short, short, short);
963PDCEX int init_pair(short, short, short);
964PDCEX WINDOW *initscr(void);
965PDCEX int innstr(char *, int);
966PDCEX int insch(chtype);
967PDCEX int insdelln(int);
968PDCEX int insertln(void);
969PDCEX int insnstr(const char *, int);
970PDCEX int insstr(const char *);
971PDCEX int instr(char *);
972PDCEX int intrflush(WINDOW *, bool);
973PDCEX bool isendwin(void);
974PDCEX bool is_linetouched(WINDOW *, int);
975PDCEX bool is_wintouched(WINDOW *);
976PDCEX char *keyname(int);
977PDCEX int keypad(WINDOW *, bool);
978PDCEX char killchar(void);
979PDCEX int leaveok(WINDOW *, bool);
980PDCEX char *longname(void);
981PDCEX int meta(WINDOW *, bool);
982PDCEX int move(int, int);
983PDCEX int mvaddch(int, int, const chtype);
984PDCEX int mvaddchnstr(int, int, const chtype *, int);
985PDCEX int mvaddchstr(int, int, const chtype *);
986PDCEX int mvaddnstr(int, int, const char *, int);
987PDCEX int mvaddstr(int, int, const char *);
988PDCEX int mvchgat(int, int, int, attr_t, short, const void *);
989PDCEX int mvcur(int, int, int, int);
990PDCEX int mvdelch(int, int);
991PDCEX int mvderwin(WINDOW *, int, int);
992PDCEX int mvgetch(int, int);
993PDCEX int mvgetnstr(int, int, char *, int);
994PDCEX int mvgetstr(int, int, char *);
995PDCEX int mvhline(int, int, chtype, int);
996PDCEX chtype mvinch(int, int);
997PDCEX int mvinchnstr(int, int, chtype *, int);
998PDCEX int mvinchstr(int, int, chtype *);
999PDCEX int mvinnstr(int, int, char *, int);
1000PDCEX int mvinsch(int, int, chtype);
1001PDCEX int mvinsnstr(int, int, const char *, int);
1002PDCEX int mvinsstr(int, int, const char *);
1003PDCEX int mvinstr(int, int, char *);
1004PDCEX int mvprintw(int, int, const char *, ...);
1005PDCEX int mvscanw(int, int, const char *, ...);
1006PDCEX int mvvline(int, int, chtype, int);
1007PDCEX int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
1008PDCEX int mvwaddchstr(WINDOW *, int, int, const chtype *);
1009PDCEX int mvwaddch(WINDOW *, int, int, const chtype);
1010PDCEX int mvwaddnstr(WINDOW *, int, int, const char *, int);
1011PDCEX int mvwaddstr(WINDOW *, int, int, const char *);
1012PDCEX int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
1013PDCEX int mvwdelch(WINDOW *, int, int);
1014PDCEX int mvwgetch(WINDOW *, int, int);
1015PDCEX int mvwgetnstr(WINDOW *, int, int, char *, int);
1016PDCEX int mvwgetstr(WINDOW *, int, int, char *);
1017PDCEX int mvwhline(WINDOW *, int, int, chtype, int);
1018PDCEX int mvwinchnstr(WINDOW *, int, int, chtype *, int);
1019PDCEX int mvwinchstr(WINDOW *, int, int, chtype *);
1020PDCEX chtype mvwinch(WINDOW *, int, int);
1021PDCEX int mvwinnstr(WINDOW *, int, int, char *, int);
1022PDCEX int mvwinsch(WINDOW *, int, int, chtype);
1023PDCEX int mvwinsnstr(WINDOW *, int, int, const char *, int);
1024PDCEX int mvwinsstr(WINDOW *, int, int, const char *);
1025PDCEX int mvwinstr(WINDOW *, int, int, char *);
1026PDCEX int mvwin(WINDOW *, int, int);
1027PDCEX int mvwprintw(WINDOW *, int, int, const char *, ...);
1028PDCEX int mvwscanw(WINDOW *, int, int, const char *, ...);
1029PDCEX int mvwvline(WINDOW *, int, int, chtype, int);
1030PDCEX int napms(int);
1031PDCEX WINDOW *newpad(int, int);
1032PDCEX SCREEN *newterm(const char *, FILE *, FILE *);
1033PDCEX WINDOW *newwin(int, int, int, int);
1034PDCEX int nl(void);
1035PDCEX int nocbreak(void);
1036PDCEX int nodelay(WINDOW *, bool);
1037PDCEX int noecho(void);
1038PDCEX int nonl(void);
1039PDCEX void noqiflush(void);
1040PDCEX int noraw(void);
1041PDCEX int notimeout(WINDOW *, bool);
1042PDCEX int overlay(const WINDOW *, WINDOW *);
1043PDCEX int overwrite(const WINDOW *, WINDOW *);
1044PDCEX int pair_content(short, short *, short *);
1045PDCEX int pechochar(WINDOW *, chtype);
1046PDCEX int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
1047PDCEX int prefresh(WINDOW *, int, int, int, int, int, int);
1048PDCEX int printw(const char *, ...);
1049PDCEX int putwin(WINDOW *, FILE *);
1050PDCEX void qiflush(void);
1051PDCEX int raw(void);
1052PDCEX int redrawwin(WINDOW *);
1053PDCEX int refresh(void);
1054PDCEX int reset_prog_mode(void);
1055PDCEX int reset_shell_mode(void);
1056PDCEX int resetty(void);
1057PDCEX int ripoffline(int, int (*)(WINDOW *, int));
1058PDCEX int savetty(void);
1059PDCEX int scanw(const char *, ...);
1060PDCEX int scr_dump(const char *);
1061PDCEX int scr_init(const char *);
1062PDCEX int scr_restore(const char *);
1063PDCEX int scr_set(const char *);
1064PDCEX int scrl(int);
1065PDCEX int scroll(WINDOW *);
1066PDCEX int scrollok(WINDOW *, bool);
1067PDCEX SCREEN *set_term(SCREEN *);
1068PDCEX int setscrreg(int, int);
1069PDCEX int slk_attroff(const chtype);
1070PDCEX int slk_attr_off(const attr_t, void *);
1071PDCEX int slk_attron(const chtype);
1072PDCEX int slk_attr_on(const attr_t, void *);
1073PDCEX int slk_attrset(const chtype);
1074PDCEX int slk_attr_set(const attr_t, short, void *);
1075PDCEX int slk_clear(void);
1076PDCEX int slk_color(short);
1077PDCEX int slk_init(int);
1078PDCEX char *slk_label(int);
1079PDCEX int slk_noutrefresh(void);
1080PDCEX int slk_refresh(void);
1081PDCEX int slk_restore(void);
1082PDCEX int slk_set(int, const char *, int);
1083PDCEX int slk_touch(void);
1084PDCEX int standend(void);
1085PDCEX int standout(void);
1086PDCEX int start_color(void);
1087PDCEX WINDOW *subpad(WINDOW *, int, int, int, int);
1088PDCEX WINDOW *subwin(WINDOW *, int, int, int, int);
1089PDCEX int syncok(WINDOW *, bool);
1090PDCEX chtype termattrs(void);
1091PDCEX attr_t term_attrs(void);
1092PDCEX char *termname(void);
1093PDCEX void timeout(int);
1094PDCEX int touchline(WINDOW *, int, int);
1095PDCEX int touchwin(WINDOW *);
1096PDCEX int typeahead(int);
1097PDCEX int untouchwin(WINDOW *);
1098PDCEX void use_env(bool);
1099PDCEX int vidattr(chtype);
1100PDCEX int vid_attr(attr_t, short, void *);
1101PDCEX int vidputs(chtype, int (*)(int));
1102PDCEX int vid_puts(attr_t, short, void *, int (*)(int));
1103PDCEX int vline(chtype, int);
1104PDCEX int vw_printw(WINDOW *, const char *, va_list);
1105PDCEX int vwprintw(WINDOW *, const char *, va_list);
1106PDCEX int vw_scanw(WINDOW *, const char *, va_list);
1107PDCEX int vwscanw(WINDOW *, const char *, va_list);
1108PDCEX int waddchnstr(WINDOW *, const chtype *, int);
1109PDCEX int waddchstr(WINDOW *, const chtype *);
1110PDCEX int waddch(WINDOW *, const chtype);
1111PDCEX int waddnstr(WINDOW *, const char *, int);
1112PDCEX int waddstr(WINDOW *, const char *);
1113PDCEX int wattroff(WINDOW *, chtype);
1114PDCEX int wattron(WINDOW *, chtype);
1115PDCEX int wattrset(WINDOW *, chtype);
1116PDCEX int wattr_get(WINDOW *, attr_t *, short *, void *);
1117PDCEX int wattr_off(WINDOW *, attr_t, void *);
1118PDCEX int wattr_on(WINDOW *, attr_t, void *);
1119PDCEX int wattr_set(WINDOW *, attr_t, short, void *);
1120PDCEX void wbkgdset(WINDOW *, chtype);
1121PDCEX int wbkgd(WINDOW *, chtype);
1122PDCEX int wborder(WINDOW *, chtype, chtype, chtype, chtype,
1123 chtype, chtype, chtype, chtype);
1124PDCEX int wchgat(WINDOW *, int, attr_t, short, const void *);
1125PDCEX int wclear(WINDOW *);
1126PDCEX int wclrtobot(WINDOW *);
1127PDCEX int wclrtoeol(WINDOW *);
1128PDCEX int wcolor_set(WINDOW *, short, void *);
1129PDCEX void wcursyncup(WINDOW *);
1130PDCEX int wdelch(WINDOW *);
1131PDCEX int wdeleteln(WINDOW *);
1132PDCEX int wechochar(WINDOW *, const chtype);
1133PDCEX int werase(WINDOW *);
1134PDCEX int wgetch(WINDOW *);
1135PDCEX int wgetnstr(WINDOW *, char *, int);
1136PDCEX int wgetstr(WINDOW *, char *);
1137PDCEX int whline(WINDOW *, chtype, int);
1138PDCEX int winchnstr(WINDOW *, chtype *, int);
1139PDCEX int winchstr(WINDOW *, chtype *);
1140PDCEX chtype winch(WINDOW *);
1141PDCEX int winnstr(WINDOW *, char *, int);
1142PDCEX int winsch(WINDOW *, chtype);
1143PDCEX int winsdelln(WINDOW *, int);
1144PDCEX int winsertln(WINDOW *);
1145PDCEX int winsnstr(WINDOW *, const char *, int);
1146PDCEX int winsstr(WINDOW *, const char *);
1147PDCEX int winstr(WINDOW *, char *);
1148PDCEX int wmove(WINDOW *, int, int);
1149PDCEX int wnoutrefresh(WINDOW *);
1150PDCEX int wprintw(WINDOW *, const char *, ...);
1151PDCEX int wredrawln(WINDOW *, int, int);
1152PDCEX int wrefresh(WINDOW *);
1153PDCEX int wscanw(WINDOW *, const char *, ...);
1154PDCEX int wscrl(WINDOW *, int);
1155PDCEX int wsetscrreg(WINDOW *, int, int);
1156PDCEX int wstandend(WINDOW *);
1157PDCEX int wstandout(WINDOW *);
1158PDCEX void wsyncdown(WINDOW *);
1159PDCEX void wsyncup(WINDOW *);
1160PDCEX void wtimeout(WINDOW *, int);
1161PDCEX int wtouchln(WINDOW *, int, int, int);
1162PDCEX int wvline(WINDOW *, chtype, int);
1163
1164/* Wide-character functions */
1165
1166#ifdef PDC_WIDE
1167PDCEX int addnwstr(const wchar_t *, int);
1168PDCEX int addwstr(const wchar_t *);
1169PDCEX int add_wch(const cchar_t *);
1170PDCEX int add_wchnstr(const cchar_t *, int);
1171PDCEX int add_wchstr(const cchar_t *);
1172PDCEX int bkgrnd(const cchar_t *);
1173PDCEX void bkgrndset(const cchar_t *);
1174PDCEX int border_set(const cchar_t *, const cchar_t *, const cchar_t *,
1175 const cchar_t *, const cchar_t *, const cchar_t *,
1176 const cchar_t *, const cchar_t *);
1177PDCEX int box_set(WINDOW *, const cchar_t *, const cchar_t *);
1178PDCEX int echo_wchar(const cchar_t *);
1179PDCEX int erasewchar(wchar_t *);
1180PDCEX int getbkgrnd(cchar_t *);
1181PDCEX int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
1182PDCEX int getn_wstr(wint_t *, int);
1183PDCEX int get_wch(wint_t *);
1184PDCEX int get_wstr(wint_t *);
1185PDCEX int hline_set(const cchar_t *, int);
1186PDCEX int innwstr(wchar_t *, int);
1187PDCEX int ins_nwstr(const wchar_t *, int);
1188PDCEX int ins_wch(const cchar_t *);
1189PDCEX int ins_wstr(const wchar_t *);
1190PDCEX int inwstr(wchar_t *);
1191PDCEX int in_wch(cchar_t *);
1192PDCEX int in_wchnstr(cchar_t *, int);
1193PDCEX int in_wchstr(cchar_t *);
1194PDCEX char *key_name(wchar_t);
1195PDCEX int killwchar(wchar_t *);
1196PDCEX int mvaddnwstr(int, int, const wchar_t *, int);
1197PDCEX int mvaddwstr(int, int, const wchar_t *);
1198PDCEX int mvadd_wch(int, int, const cchar_t *);
1199PDCEX int mvadd_wchnstr(int, int, const cchar_t *, int);
1200PDCEX int mvadd_wchstr(int, int, const cchar_t *);
1201PDCEX int mvgetn_wstr(int, int, wint_t *, int);
1202PDCEX int mvget_wch(int, int, wint_t *);
1203PDCEX int mvget_wstr(int, int, wint_t *);
1204PDCEX int mvhline_set(int, int, const cchar_t *, int);
1205PDCEX int mvinnwstr(int, int, wchar_t *, int);
1206PDCEX int mvins_nwstr(int, int, const wchar_t *, int);
1207PDCEX int mvins_wch(int, int, const cchar_t *);
1208PDCEX int mvins_wstr(int, int, const wchar_t *);
1209PDCEX int mvinwstr(int, int, wchar_t *);
1210PDCEX int mvin_wch(int, int, cchar_t *);
1211PDCEX int mvin_wchnstr(int, int, cchar_t *, int);
1212PDCEX int mvin_wchstr(int, int, cchar_t *);
1213PDCEX int mvvline_set(int, int, const cchar_t *, int);
1214PDCEX int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
1215PDCEX int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
1216PDCEX int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
1217PDCEX int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
1218PDCEX int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
1219PDCEX int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
1220PDCEX int mvwget_wch(WINDOW *, int, int, wint_t *);
1221PDCEX int mvwget_wstr(WINDOW *, int, int, wint_t *);
1222PDCEX int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
1223PDCEX int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
1224PDCEX int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
1225PDCEX int mvwins_wch(WINDOW *, int, int, const cchar_t *);
1226PDCEX int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
1227PDCEX int mvwin_wch(WINDOW *, int, int, cchar_t *);
1228PDCEX int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
1229PDCEX int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
1230PDCEX int mvwinwstr(WINDOW *, int, int, wchar_t *);
1231PDCEX int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
1232PDCEX int pecho_wchar(WINDOW *, const cchar_t*);
1233PDCEX int setcchar(cchar_t*, const wchar_t*, const attr_t,
1234 short, const void*);
1235PDCEX int slk_wset(int, const wchar_t *, int);
1236PDCEX int unget_wch(const wchar_t);
1237PDCEX int vline_set(const cchar_t *, int);
1238PDCEX int waddnwstr(WINDOW *, const wchar_t *, int);
1239PDCEX int waddwstr(WINDOW *, const wchar_t *);
1240PDCEX int wadd_wch(WINDOW *, const cchar_t *);
1241PDCEX int wadd_wchnstr(WINDOW *, const cchar_t *, int);
1242PDCEX int wadd_wchstr(WINDOW *, const cchar_t *);
1243PDCEX int wbkgrnd(WINDOW *, const cchar_t *);
1244PDCEX void wbkgrndset(WINDOW *, const cchar_t *);
1245PDCEX int wborder_set(WINDOW *, const cchar_t *, const cchar_t *,
1246 const cchar_t *, const cchar_t *, const cchar_t *,
1247 const cchar_t *, const cchar_t *, const cchar_t *);
1248PDCEX int wecho_wchar(WINDOW *, const cchar_t *);
1249PDCEX int wgetbkgrnd(WINDOW *, cchar_t *);
1250PDCEX int wgetn_wstr(WINDOW *, wint_t *, int);
1251PDCEX int wget_wch(WINDOW *, wint_t *);
1252PDCEX int wget_wstr(WINDOW *, wint_t *);
1253PDCEX int whline_set(WINDOW *, const cchar_t *, int);
1254PDCEX int winnwstr(WINDOW *, wchar_t *, int);
1255PDCEX int wins_nwstr(WINDOW *, const wchar_t *, int);
1256PDCEX int wins_wch(WINDOW *, const cchar_t *);
1257PDCEX int wins_wstr(WINDOW *, const wchar_t *);
1258PDCEX int winwstr(WINDOW *, wchar_t *);
1259PDCEX int win_wch(WINDOW *, cchar_t *);
1260PDCEX int win_wchnstr(WINDOW *, cchar_t *, int);
1261PDCEX int win_wchstr(WINDOW *, cchar_t *);
1262PDCEX wchar_t *wunctrl(cchar_t *);
1263PDCEX int wvline_set(WINDOW *, const cchar_t *, int);
1264#endif
1265
1266/* Quasi-standard */
1267
1268PDCEX chtype getattrs(WINDOW *);
1269PDCEX int getbegx(WINDOW *);
1270PDCEX int getbegy(WINDOW *);
1271PDCEX int getmaxx(WINDOW *);
1272PDCEX int getmaxy(WINDOW *);
1273PDCEX int getparx(WINDOW *);
1274PDCEX int getpary(WINDOW *);
1275PDCEX int getcurx(WINDOW *);
1276PDCEX int getcury(WINDOW *);
1277PDCEX void traceoff(void);
1278PDCEX void traceon(void);
1279PDCEX char *unctrl(chtype);
1280
1281PDCEX int crmode(void);
1282PDCEX int nocrmode(void);
1283PDCEX int draino(int);
1284PDCEX int resetterm(void);
1285PDCEX int fixterm(void);
1286PDCEX int saveterm(void);
1287PDCEX void setsyx(int, int);
1288
1289PDCEX int mouse_set(mmask_t);
1290PDCEX int mouse_on(mmask_t);
1291PDCEX int mouse_off(mmask_t);
1292PDCEX int request_mouse_pos(void);
1293PDCEX void wmouse_position(WINDOW *, int *, int *);
1294PDCEX mmask_t getmouse(void);
1295
1296/* ncurses */
1297
1298PDCEX int alloc_pair(int, int);
1299PDCEX int assume_default_colors(int, int);
1300PDCEX const char *curses_version(void);
1301PDCEX int find_pair(int, int);
1302PDCEX int free_pair(int);
1303PDCEX bool has_key(int);
1304PDCEX bool is_cleared(const WINDOW *);
1305PDCEX bool is_idcok(const WINDOW *);
1306PDCEX bool is_idlok(const WINDOW *);
1307PDCEX bool is_immedok(const WINDOW *);
1308PDCEX bool is_keypad(const WINDOW *);
1309PDCEX bool is_leaveok(const WINDOW *);
1310PDCEX bool is_nodelay(const WINDOW *);
1311PDCEX bool is_notimeout(const WINDOW *);
1312PDCEX bool is_pad(const WINDOW *);
1313PDCEX bool is_scrollok(const WINDOW *);
1314PDCEX bool is_subwin(const WINDOW *);
1315PDCEX bool is_syncok(const WINDOW *);
1316PDCEX int set_tabsize(int);
1317PDCEX int use_default_colors(void);
1318PDCEX int wgetdelay(const WINDOW *);
1319PDCEX WINDOW *wgetparent(const WINDOW *);
1320PDCEX int wgetscrreg(const WINDOW *, int *, int *);
1321PDCEX int wresize(WINDOW *, int, int);
1322
1323PDCEX bool has_mouse(void);
1324PDCEX int mouseinterval(int);
1325PDCEX mmask_t mousemask(mmask_t, mmask_t *);
1326PDCEX bool mouse_trafo(int *, int *, bool);
1327PDCEX int nc_getmouse(MEVENT *);
1328PDCEX int ungetmouse(MEVENT *);
1329PDCEX bool wenclose(const WINDOW *, int, int);
1330PDCEX bool wmouse_trafo(const WINDOW *, int *, int *, bool);
1331
1332/* PDCurses */
1333
1334PDCEX int addrawch(chtype);
1335PDCEX int insrawch(chtype);
1336PDCEX bool is_termresized(void);
1337PDCEX int mvaddrawch(int, int, chtype);
1338PDCEX int mvdeleteln(int, int);
1339PDCEX int mvinsertln(int, int);
1340PDCEX int mvinsrawch(int, int, chtype);
1341PDCEX int mvwaddrawch(WINDOW *, int, int, chtype);
1342PDCEX int mvwdeleteln(WINDOW *, int, int);
1343PDCEX int mvwinsertln(WINDOW *, int, int);
1344PDCEX int mvwinsrawch(WINDOW *, int, int, chtype);
1345PDCEX int raw_output(bool);
1346PDCEX int resize_term(int, int);
1347PDCEX WINDOW *resize_window(WINDOW *, int, int);
1348PDCEX int waddrawch(WINDOW *, chtype);
1349PDCEX int winsrawch(WINDOW *, chtype);
1350PDCEX char wordchar(void);
1351
1352#ifdef PDC_WIDE
1353PDCEX wchar_t *slk_wlabel(int);
1354#endif
1355
1356PDCEX void PDC_debug(const char *, ...);
1357PDCEX void PDC_get_version(PDC_VERSION *);
1358PDCEX int PDC_ungetch(int);
1359PDCEX int PDC_set_blink(bool);
1360PDCEX int PDC_set_bold(bool);
1361PDCEX int PDC_set_line_color(short);
1362PDCEX void PDC_set_title(const char *);
1363
1364PDCEX int PDC_clearclipboard(void);
1365PDCEX int PDC_freeclipboard(char *);
1366PDCEX int PDC_getclipboard(char **, long *);
1367PDCEX int PDC_setclipboard(const char *, long);
1368
1369PDCEX unsigned long PDC_get_key_modifiers(void);
1370PDCEX int PDC_return_key_modifiers(bool);
1371
1372#ifdef XCURSES
1373PDCEX WINDOW *Xinitscr(int, char **);
1374PDCEX void XCursesExit(void);
1375PDCEX int sb_init(void);
1376PDCEX int sb_set_horz(int, int, int);
1377PDCEX int sb_set_vert(int, int, int);
1378PDCEX int sb_get_horz(int *, int *, int *);
1379PDCEX int sb_get_vert(int *, int *, int *);
1380PDCEX int sb_refresh(void);
1381#endif
1382
1383/* NetBSD */
1384
1385PDCEX int touchoverlap(const WINDOW *, WINDOW *);
1386PDCEX int underend(void);
1387PDCEX int underscore(void);
1388PDCEX int wunderend(WINDOW *);
1389PDCEX int wunderscore(WINDOW *);
1390
1391/*** Functions defined as macros ***/
1392
1393/* getch() and ungetch() conflict with some DOS libraries */
1394
1395#define getch() wgetch(stdscr)
1396#define ungetch(ch) PDC_ungetch(ch)
1397
1398#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR)
1399#define PAIR_NUMBER(n) (((n) & A_COLOR) >> PDC_COLOR_SHIFT)
1400
1401/* These will _only_ work as macros */
1402
1403#define getbegyx(w, y, x) (y = getbegy(w), x = getbegx(w))
1404#define getmaxyx(w, y, x) (y = getmaxy(w), x = getmaxx(w))
1405#define getparyx(w, y, x) (y = getpary(w), x = getparx(w))
1406#define getyx(w, y, x) (y = getcury(w), x = getcurx(w))
1407
1408#define getsyx(y, x) { if (curscr->_leaveit) (y)=(x)=-1; \
1409 else getyx(curscr,(y),(x)); }
1410
1411#ifdef NCURSES_MOUSE_VERSION
1412# define getmouse(x) nc_getmouse(x)
1413#endif
1414
1415/* Deprecated */
1416
1417#define PDC_save_key_modifiers(x) (OK)
1418#define PDC_get_input_fd() 0
1419
1420/* return codes from PDC_getclipboard() and PDC_setclipboard() calls */
1421
1422#define PDC_CLIP_SUCCESS 0
1423#define PDC_CLIP_ACCESS_ERROR 1
1424#define PDC_CLIP_EMPTY 2
1425#define PDC_CLIP_MEMORY_ERROR 3
1426
1427/* PDCurses key modifier masks */
1428
1429#define PDC_KEY_MODIFIER_SHIFT 1
1430#define PDC_KEY_MODIFIER_CONTROL 2
1431#define PDC_KEY_MODIFIER_ALT 4
1432#define PDC_KEY_MODIFIER_NUMLOCK 8
1433
1434#ifdef __cplusplus
1435# ifndef PDC_PP98
1436# undef bool
1437# endif
1438}
1439#endif
1440
1441#endif /* __PDCURSES__ */