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