1 /* $OpenBSD: curses.h,v 1.63 2022/10/10 09:03:08 nicm Exp $ */ 2 3 /**************************************************************************** 4 * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * 5 * * 6 * Permission is hereby granted, free of charge, to any person obtaining a * 7 * copy of this software and associated documentation files (the * 8 * "Software"), to deal in the Software without restriction, including * 9 * without limitation the rights to use, copy, modify, merge, publish, * 10 * distribute, distribute with modifications, sublicense, and/or sell * 11 * copies of the Software, and to permit persons to whom the Software is * 12 * furnished to do so, subject to the following conditions: * 13 * * 14 * The above copyright notice and this permission notice shall be included * 15 * in all copies or substantial portions of the Software. * 16 * * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 24 * * 25 * Except as contained in this notice, the name(s) of the above copyright * 26 * holders shall not be used in advertising or otherwise to promote the * 27 * sale, use or other dealings in this Software without prior written * 28 * authorization. * 29 ****************************************************************************/ 30 31 /**************************************************************************** 32 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * 33 * and: Eric S. Raymond <esr@snark.thyrsus.com> * 34 * and: Thomas E. Dickey 1996-on * 35 ****************************************************************************/ 36 37 /* $Id: curses.h,v 1.63 2022/10/10 09:03:08 nicm Exp $ */ 38 39 #ifndef __NCURSES_H 40 #define __NCURSES_H 41 42 #define CURSES 1 43 #define CURSES_H 1 44 45 /* This should be defined for the enhanced functionality to be visible. 46 * However, some of the wide-character (enhanced) functionality is missing. 47 * So we do not define it (yet). 48 #define _XOPEN_CURSES 1 49 */ 50 51 /* These are defined only in curses.h, and are used for conditional compiles */ 52 #define NCURSES_VERSION_MAJOR 5 53 #define NCURSES_VERSION_MINOR 7 54 #define NCURSES_VERSION_PATCH 20081102 55 56 /* This is defined in more than one ncurses header, for identification */ 57 #undef NCURSES_VERSION 58 #define NCURSES_VERSION "5.7" 59 60 #if !defined(NCURSES_IMPEXP) 61 # define NCURSES_IMPEXP /* nothing */ 62 #endif 63 #if !defined(NCURSES_API) 64 # define NCURSES_API /* nothing */ 65 #endif 66 #if !defined(NCURSES_EXPORT) 67 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API 68 #endif 69 #if !defined(NCURSES_EXPORT_VAR) 70 # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type 71 #endif 72 73 /* 74 * Identify the mouse encoding version. 75 */ 76 #define NCURSES_MOUSE_VERSION 1 77 78 /* 79 * User-definable tweak to disable the include of <stdbool.h>. 80 */ 81 #ifndef NCURSES_ENABLE_STDBOOL_H 82 #define NCURSES_ENABLE_STDBOOL_H 1 83 #endif 84 85 /* 86 * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses 87 * configured using --disable-macros. 88 */ 89 #ifdef NCURSES_NOMACROS 90 #ifndef NCURSES_ATTR_T 91 #define NCURSES_ATTR_T attr_t 92 #endif 93 #endif /* NCURSES_NOMACROS */ 94 95 #ifndef NCURSES_ATTR_T 96 #define NCURSES_ATTR_T int 97 #endif 98 99 /* 100 * Expands to 'const' if ncurses is configured using --enable-const. Note that 101 * doing so makes it incompatible with other implementations of X/Open Curses. 102 */ 103 #undef NCURSES_CONST 104 #define NCURSES_CONST const 105 106 #undef NCURSES_INLINE 107 #define NCURSES_INLINE inline 108 109 /* 110 * The internal type used for color values 111 */ 112 #undef NCURSES_COLOR_T 113 #define NCURSES_COLOR_T short 114 115 /* 116 * Definition used to make WINDOW and similar structs opaque. 117 */ 118 #ifndef NCURSES_OPAQUE 119 #define NCURSES_OPAQUE 0 120 #endif 121 122 /* 123 * The internal type used for window dimensions. 124 */ 125 #undef NCURSES_SIZE_T 126 #define NCURSES_SIZE_T short 127 128 /* 129 * Control whether tparm() supports varargs or fixed-parameter list. 130 */ 131 #undef NCURSES_TPARM_VARARGS 132 #define NCURSES_TPARM_VARARGS 1 133 134 /* 135 * NCURSES_CH_T is used in building the library, but not used otherwise in 136 * this header file, since that would make the normal/wide-character versions 137 * of the header incompatible. 138 */ 139 #undef NCURSES_CH_T 140 #define NCURSES_CH_T cchar_t 141 142 #if 0 && defined(_LP64) 143 typedef unsigned chtype; 144 typedef unsigned mmask_t; 145 #else 146 typedef unsigned int chtype; 147 typedef unsigned long mmask_t; 148 #endif 149 150 #include <stdio.h> 151 #include <unctrl.h> 152 153 /* 154 * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or 155 * conflicting) when _XOPEN_SOURCE is 500 or greater. If NCURSES_WIDECHAR is 156 * not already defined, e.g., if the platform relies upon nonstandard feature 157 * test macros, define it at this point if the standard feature test macros 158 * indicate that it should be defined. 159 */ 160 #ifndef NCURSES_WIDECHAR 161 #if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500)) 162 #define NCURSES_WIDECHAR 1 163 #else 164 #define NCURSES_WIDECHAR 0 165 #endif 166 #endif /* NCURSES_WIDECHAR */ 167 168 #include <stdarg.h> /* we need va_list */ 169 #if NCURSES_WIDECHAR 170 #include <stddef.h> /* we want wchar_t */ 171 #endif 172 173 /* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also 174 * implement it. If so, we must use the C++ compiler's type to avoid conflict 175 * with other interfaces. 176 * 177 * A further complication is that <stdbool.h> may declare 'bool' to be a 178 * different type, such as an enum which is not necessarily compatible with 179 * C++. If we have <stdbool.h>, make 'bool' a macro, so users may #undef it. 180 * Otherwise, let it remain a typedef to avoid conflicts with other #define's. 181 * In either case, make a typedef for NCURSES_BOOL which can be used if needed 182 * from either C or C++. 183 */ 184 185 #undef TRUE 186 #define TRUE 1 187 188 #undef FALSE 189 #define FALSE 0 190 191 typedef unsigned char NCURSES_BOOL; 192 193 #if defined(__cplusplus) /* __cplusplus, etc. */ 194 195 /* use the C++ compiler's bool type */ 196 #define NCURSES_BOOL bool 197 198 #else /* c89, c99, etc. */ 199 200 #if NCURSES_ENABLE_STDBOOL_H 201 #include <stdbool.h> 202 /* use whatever the C compiler decides bool really is */ 203 #define NCURSES_BOOL bool 204 #else 205 /* there is no predefined bool - use our own */ 206 #undef bool 207 #define bool NCURSES_BOOL 208 #endif 209 210 #endif /* !__cplusplus, etc. */ 211 212 #ifdef __cplusplus 213 extern "C" { 214 #define NCURSES_CAST(type,value) static_cast<type>(value) 215 #else 216 #define NCURSES_CAST(type,value) (type)(value) 217 #endif 218 219 /* 220 * X/Open attributes. In the ncurses implementation, they are identical to the 221 * A_ attributes. 222 */ 223 #define WA_ATTRIBUTES A_ATTRIBUTES 224 #define WA_NORMAL A_NORMAL 225 #define WA_STANDOUT A_STANDOUT 226 #define WA_UNDERLINE A_UNDERLINE 227 #define WA_REVERSE A_REVERSE 228 #define WA_BLINK A_BLINK 229 #define WA_DIM A_DIM 230 #define WA_BOLD A_BOLD 231 #define WA_ALTCHARSET A_ALTCHARSET 232 #define WA_INVIS A_INVIS 233 #define WA_PROTECT A_PROTECT 234 #define WA_HORIZONTAL A_HORIZONTAL 235 #define WA_LEFT A_LEFT 236 #define WA_LOW A_LOW 237 #define WA_RIGHT A_RIGHT 238 #define WA_TOP A_TOP 239 #define WA_VERTICAL A_VERTICAL 240 241 /* colors */ 242 #define COLOR_BLACK 0 243 #define COLOR_RED 1 244 #define COLOR_GREEN 2 245 #define COLOR_YELLOW 3 246 #define COLOR_BLUE 4 247 #define COLOR_MAGENTA 5 248 #define COLOR_CYAN 6 249 #define COLOR_WHITE 7 250 251 /* line graphics */ 252 253 #if 0 || 0 254 NCURSES_WRAPPED_VAR(chtype*, acs_map); 255 #define acs_map (_nc_acs_map()) 256 #else 257 extern NCURSES_EXPORT_VAR(chtype) acs_map[]; 258 #endif 259 260 #define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)]) 261 262 /* VT100 symbols begin here */ 263 #define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */ 264 #define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */ 265 #define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */ 266 #define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */ 267 #define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */ 268 #define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */ 269 #define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */ 270 #define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */ 271 #define ACS_HLINE NCURSES_ACS('q') /* horizontal line */ 272 #define ACS_VLINE NCURSES_ACS('x') /* vertical line */ 273 #define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */ 274 #define ACS_S1 NCURSES_ACS('o') /* scan line 1 */ 275 #define ACS_S9 NCURSES_ACS('s') /* scan line 9 */ 276 #define ACS_DIAMOND NCURSES_ACS('`') /* diamond */ 277 #define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */ 278 #define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */ 279 #define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */ 280 #define ACS_BULLET NCURSES_ACS('~') /* bullet */ 281 /* Teletype 5410v1 symbols begin here */ 282 #define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */ 283 #define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */ 284 #define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */ 285 #define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */ 286 #define ACS_BOARD NCURSES_ACS('h') /* board of squares */ 287 #define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */ 288 #define ACS_BLOCK NCURSES_ACS('0') /* solid square block */ 289 /* 290 * These aren't documented, but a lot of System Vs have them anyway 291 * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings). 292 * The ACS_names may not match AT&T's, our source didn't know them. 293 */ 294 #define ACS_S3 NCURSES_ACS('p') /* scan line 3 */ 295 #define ACS_S7 NCURSES_ACS('r') /* scan line 7 */ 296 #define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */ 297 #define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */ 298 #define ACS_PI NCURSES_ACS('{') /* Pi */ 299 #define ACS_NEQUAL NCURSES_ACS('|') /* not equal */ 300 #define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */ 301 302 /* 303 * Line drawing ACS names are of the form ACS_trbl, where t is the top, r 304 * is the right, b is the bottom, and l is the left. t, r, b, and l might 305 * be B (blank), S (single), D (double), or T (thick). The subset defined 306 * here only uses B and S. 307 */ 308 #define ACS_BSSB ACS_ULCORNER 309 #define ACS_SSBB ACS_LLCORNER 310 #define ACS_BBSS ACS_URCORNER 311 #define ACS_SBBS ACS_LRCORNER 312 #define ACS_SBSS ACS_RTEE 313 #define ACS_SSSB ACS_LTEE 314 #define ACS_SSBS ACS_BTEE 315 #define ACS_BSSS ACS_TTEE 316 #define ACS_BSBS ACS_HLINE 317 #define ACS_SBSB ACS_VLINE 318 #define ACS_SSSS ACS_PLUS 319 320 #undef ERR 321 #define ERR (-1) 322 323 #undef OK 324 #define OK (0) 325 326 /* values for the _flags member */ 327 #define _SUBWIN 0x01 /* is this a sub-window? */ 328 #define _ENDLINE 0x02 /* is the window flush right? */ 329 #define _FULLWIN 0x04 /* is the window full-screen? */ 330 #define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */ 331 #define _ISPAD 0x10 /* is this window a pad? */ 332 #define _HASMOVED 0x20 /* has cursor moved since last refresh? */ 333 #define _WRAPPED 0x40 /* cursor was just wrappped */ 334 335 /* 336 * this value is used in the firstchar and lastchar fields to mark 337 * unchanged lines 338 */ 339 #define _NOCHANGE -1 340 341 /* 342 * this value is used in the oldindex field to mark lines created by insertions 343 * and scrolls. 344 */ 345 #define _NEWINDEX -1 346 347 typedef struct screen SCREEN; 348 typedef struct _win_st WINDOW; 349 350 typedef chtype attr_t; /* ...must be at least as wide as chtype */ 351 352 #if NCURSES_WIDECHAR 353 354 #if 0 355 #ifdef mblen /* libutf8.h defines it w/o undefining first */ 356 #undef mblen 357 #endif 358 #include <libutf8.h> 359 #endif 360 361 #if 1 362 #include <wchar.h> /* ...to get mbstate_t, etc. */ 363 #endif 364 365 #if 0 366 typedef unsigned short wchar_t; 367 #endif 368 369 #if 0 370 typedef unsigned int wint_t; 371 #endif 372 373 #define CCHARW_MAX 5 374 typedef struct 375 { 376 attr_t attr; 377 wchar_t chars[CCHARW_MAX]; 378 #if 0 379 #undef NCURSES_EXT_COLORS 380 #define NCURSES_EXT_COLORS 20081102 381 int ext_color; /* color pair, must be more than 16-bits */ 382 #endif 383 } 384 cchar_t; 385 386 #endif /* NCURSES_WIDECHAR */ 387 388 #if !NCURSES_OPAQUE 389 struct ldat; 390 391 struct _win_st 392 { 393 NCURSES_SIZE_T _cury, _curx; /* current cursor position */ 394 395 /* window location and size */ 396 NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */ 397 NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */ 398 399 short _flags; /* window state flags */ 400 401 /* attribute tracking */ 402 attr_t _attrs; /* current attribute for non-space character */ 403 chtype _bkgd; /* current background char/attribute pair */ 404 405 /* option values set by user */ 406 bool _notimeout; /* no time out on function-key entry? */ 407 bool _clear; /* consider all data in the window invalid? */ 408 bool _leaveok; /* OK to not reset cursor on exit? */ 409 bool _scroll; /* OK to scroll this window? */ 410 bool _idlok; /* OK to use insert/delete line? */ 411 bool _idcok; /* OK to use insert/delete char? */ 412 bool _immed; /* window in immed mode? (not yet used) */ 413 bool _sync; /* window in sync mode? */ 414 bool _use_keypad; /* process function keys into KEY_ symbols? */ 415 int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ 416 417 struct ldat *_line; /* the actual line data */ 418 419 /* global screen state */ 420 NCURSES_SIZE_T _regtop; /* top line of scrolling region */ 421 NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */ 422 423 /* these are used only if this is a sub-window */ 424 int _parx; /* x coordinate of this window in parent */ 425 int _pary; /* y coordinate of this window in parent */ 426 WINDOW *_parent; /* pointer to parent if a sub-window */ 427 428 /* these are used only if this is a pad */ 429 struct pdat 430 { 431 NCURSES_SIZE_T _pad_y, _pad_x; 432 NCURSES_SIZE_T _pad_top, _pad_left; 433 NCURSES_SIZE_T _pad_bottom, _pad_right; 434 } _pad; 435 436 NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ 437 438 #if NCURSES_WIDECHAR 439 cchar_t _bkgrnd; /* current background char/attribute pair */ 440 #if 0 441 int _color; /* current color-pair for non-space character */ 442 #endif 443 #endif 444 }; 445 #endif /* NCURSES_OPAQUE */ 446 447 /* 448 * This is an extension to support events... 449 */ 450 #if 1 451 #ifdef NCURSES_WGETCH_EVENTS 452 #if !defined(__BEOS__) || defined(__HAIKU__) 453 /* Fix _nc_timed_wait() on BEOS... */ 454 # define NCURSES_EVENT_VERSION 1 455 #endif /* !defined(__BEOS__) */ 456 457 /* 458 * Bits to set in _nc_event.data.flags 459 */ 460 # define _NC_EVENT_TIMEOUT_MSEC 1 461 # define _NC_EVENT_FILE 2 462 # define _NC_EVENT_FILE_READABLE 2 463 # if 0 /* Not supported yet... */ 464 # define _NC_EVENT_FILE_WRITABLE 4 465 # define _NC_EVENT_FILE_EXCEPTION 8 466 # endif 467 468 typedef struct 469 { 470 int type; 471 union 472 { 473 long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ 474 struct 475 { 476 unsigned int flags; 477 int fd; 478 unsigned int result; 479 } fev; /* _NC_EVENT_FILE */ 480 } data; 481 } _nc_event; 482 483 typedef struct 484 { 485 int count; 486 int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ 487 _nc_event *events[1]; 488 } _nc_eventlist; 489 490 extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *); /* experimental */ 491 extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */ 492 493 #endif /* NCURSES_WGETCH_EVENTS */ 494 #endif /* NCURSES_EXT_FUNCS */ 495 496 /* 497 * GCC (and some other compilers) define '__attribute__'; we're using this 498 * macro to alert the compiler to flag inconsistencies in printf/scanf-like 499 * function calls. Just in case '__attribute__' isn't defined, make a dummy. 500 * Old versions of G++ do not accept it anyway, at least not consistently with 501 * GCC. 502 */ 503 #if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__)) 504 #define __attribute__(p) /* nothing */ 505 #endif 506 507 /* 508 * We cannot define these in ncurses_cfg.h, since they require parameters to be 509 * passed (that is non-portable). If you happen to be using gcc with warnings 510 * enabled, define 511 * GCC_PRINTF 512 * GCC_SCANF 513 * to improve checking of calls to printw(), etc. 514 */ 515 #ifndef GCC_PRINTFLIKE 516 #if defined(GCC_PRINTF) && !defined(printf) 517 #define GCC_PRINTFLIKE(fmt,var) __attribute__((__format__(printf,fmt,var))) 518 #else 519 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ 520 #endif 521 #endif 522 523 #ifndef GCC_SCANFLIKE 524 #if defined(GCC_SCANF) && !defined(scanf) 525 #define GCC_SCANFLIKE(fmt,var) __attribute__((__format__(scanf,fmt,var))) 526 #else 527 #define GCC_SCANFLIKE(fmt,var) /*nothing*/ 528 #endif 529 #endif 530 531 #ifndef GCC_NORETURN 532 #define GCC_NORETURN /* nothing */ 533 #endif 534 535 #ifndef GCC_UNUSED 536 #define GCC_UNUSED /* nothing */ 537 #endif 538 539 /* 540 * Function prototypes. This is the complete X/Open Curses list of required 541 * functions. Those marked `generated' will have sources generated from the 542 * macro definitions later in this file, in order to satisfy XPG4.2 543 * requirements. 544 */ 545 546 extern NCURSES_EXPORT(int) addch (const chtype); /* generated */ 547 extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */ 548 extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */ 549 extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */ 550 extern NCURSES_EXPORT(int) addstr (const char *); /* generated */ 551 extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */ 552 extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */ 553 extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */ 554 extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */ 555 extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */ 556 extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */ 557 extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */ 558 extern NCURSES_EXPORT(int) baudrate (void); /* implemented */ 559 extern NCURSES_EXPORT(int) beep (void); /* implemented */ 560 extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */ 561 extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */ 562 extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ 563 extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */ 564 extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */ 565 extern NCURSES_EXPORT(int) cbreak (void); /* implemented */ 566 extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */ 567 extern NCURSES_EXPORT(int) clear (void); /* generated */ 568 extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */ 569 extern NCURSES_EXPORT(int) clrtobot (void); /* generated */ 570 extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */ 571 extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */ 572 extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */ 573 extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */ 574 extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */ 575 extern NCURSES_EXPORT(int) curs_set (int); /* implemented */ 576 extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */ 577 extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */ 578 extern NCURSES_EXPORT(int) delay_output (int); /* implemented */ 579 extern NCURSES_EXPORT(int) delch (void); /* generated */ 580 extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */ 581 extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */ 582 extern NCURSES_EXPORT(int) deleteln (void); /* generated */ 583 extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */ 584 extern NCURSES_EXPORT(int) doupdate (void); /* implemented */ 585 extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */ 586 extern NCURSES_EXPORT(int) echo (void); /* implemented */ 587 extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */ 588 extern NCURSES_EXPORT(int) erase (void); /* generated */ 589 extern NCURSES_EXPORT(int) endwin (void); /* implemented */ 590 extern NCURSES_EXPORT(char) erasechar (void); /* implemented */ 591 extern NCURSES_EXPORT(void) filter (void); /* implemented */ 592 extern NCURSES_EXPORT(int) flash (void); /* implemented */ 593 extern NCURSES_EXPORT(int) flushinp (void); /* implemented */ 594 extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */ 595 extern NCURSES_EXPORT(int) getch (void); /* generated */ 596 extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */ 597 extern NCURSES_EXPORT(int) getstr (char *); /* generated */ 598 extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */ 599 extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */ 600 extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */ 601 extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */ 602 extern NCURSES_EXPORT(bool) has_il (void); /* implemented */ 603 extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */ 604 extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */ 605 extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */ 606 extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */ 607 extern NCURSES_EXPORT(chtype) inch (void); /* generated */ 608 extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */ 609 extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */ 610 extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */ 611 extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */ 612 extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */ 613 extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */ 614 extern NCURSES_EXPORT(int) insch (chtype); /* generated */ 615 extern NCURSES_EXPORT(int) insdelln (int); /* generated */ 616 extern NCURSES_EXPORT(int) insertln (void); /* generated */ 617 extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */ 618 extern NCURSES_EXPORT(int) insstr (const char *); /* generated */ 619 extern NCURSES_EXPORT(int) instr (char *); /* generated */ 620 extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */ 621 extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */ 622 extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */ 623 extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */ 624 extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */ 625 extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */ 626 extern NCURSES_EXPORT(char) killchar (void); /* implemented */ 627 extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */ 628 extern NCURSES_EXPORT(char *) longname (void); /* implemented */ 629 extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ 630 extern NCURSES_EXPORT(int) move (int, int); /* generated */ 631 extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */ 632 extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */ 633 extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */ 634 extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */ 635 extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */ 636 extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */ 637 extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */ 638 extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */ 639 extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */ 640 extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */ 641 extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */ 642 extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */ 643 extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */ 644 extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */ 645 extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */ 646 extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */ 647 extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */ 648 extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */ 649 extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */ 650 extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */ 651 extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */ 652 extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...) /* implemented */ 653 GCC_PRINTFLIKE(3,4); 654 extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */ 655 GCC_SCANFLIKE(3,4); 656 extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */ 657 extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */ 658 extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */ 659 extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */ 660 extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */ 661 extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */ 662 extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ 663 extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */ 664 extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */ 665 extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */ 666 extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */ 667 extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */ 668 extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */ 669 extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */ 670 extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */ 671 extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */ 672 extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ 673 extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ 674 extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ 675 extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ 676 extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ 677 extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */ 678 GCC_PRINTFLIKE(4,5); 679 extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ 680 GCC_SCANFLIKE(4,5); 681 extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ 682 extern NCURSES_EXPORT(int) napms (int); /* implemented */ 683 extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ 684 extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ 685 extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ 686 extern NCURSES_EXPORT(int) nl (void); /* implemented */ 687 extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */ 688 extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */ 689 extern NCURSES_EXPORT(int) noecho (void); /* implemented */ 690 extern NCURSES_EXPORT(int) nonl (void); /* implemented */ 691 extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */ 692 extern NCURSES_EXPORT(int) noraw (void); /* implemented */ 693 extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */ 694 extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */ 695 extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */ 696 extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */ 697 extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */ 698 extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */ 699 extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */ 700 extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */ 701 extern NCURSES_EXPORT(int) printw (const char *,...) /* implemented */ 702 GCC_PRINTFLIKE(1,2); 703 extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */ 704 extern NCURSES_EXPORT(void) qiflush (void); /* implemented */ 705 extern NCURSES_EXPORT(int) raw (void); /* implemented */ 706 extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */ 707 extern NCURSES_EXPORT(int) refresh (void); /* generated */ 708 extern NCURSES_EXPORT(int) resetty (void); /* implemented */ 709 extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */ 710 extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */ 711 extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */ 712 extern NCURSES_EXPORT(int) savetty (void); /* implemented */ 713 extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */ 714 GCC_SCANFLIKE(1,2); 715 extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */ 716 extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */ 717 extern NCURSES_EXPORT(int) scrl (int); /* generated */ 718 extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */ 719 extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */ 720 extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */ 721 extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */ 722 extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */ 723 extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */ 724 extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */ 725 extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */ 726 extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */ 727 extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */ 728 extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */ 729 extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */ 730 extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */ 731 extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */ 732 extern NCURSES_EXPORT(int) slk_color (short); /* implemented */ 733 extern NCURSES_EXPORT(int) slk_init (int); /* implemented */ 734 extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */ 735 extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */ 736 extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ 737 extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ 738 extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ 739 extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ 740 extern NCURSES_EXPORT(int) standout (void); /* generated */ 741 extern NCURSES_EXPORT(int) standend (void); /* generated */ 742 extern NCURSES_EXPORT(int) start_color (void); /* implemented */ 743 extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */ 744 extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int); /* implemented */ 745 extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */ 746 extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */ 747 extern NCURSES_EXPORT(char *) termname (void); /* implemented */ 748 extern NCURSES_EXPORT(void) timeout (int); /* generated */ 749 extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */ 750 extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */ 751 extern NCURSES_EXPORT(int) typeahead (int); /* implemented */ 752 extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ 753 extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ 754 extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ 755 extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ 756 extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */ 757 extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ 758 extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list); /* implemented */ 759 extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */ 760 extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ 761 extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ 762 extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */ 763 extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */ 764 extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ 765 extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int); /* implemented */ 766 extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */ 767 extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */ 768 extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */ 769 extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */ 770 extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */ 771 extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */ 772 extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */ 773 extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */ 774 extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */ 775 extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */ 776 extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ 777 extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */ 778 extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */ 779 extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */ 780 extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */ 781 extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */ 782 extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */ 783 extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */ 784 extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */ 785 extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */ 786 extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */ 787 extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */ 788 extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */ 789 extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */ 790 extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */ 791 extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */ 792 extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */ 793 extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */ 794 extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */ 795 extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */ 796 extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */ 797 extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */ 798 extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */ 799 extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */ 800 extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */ 801 extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */ 802 extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */ 803 extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...) /* implemented */ 804 GCC_PRINTFLIKE(2,3); 805 extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */ 806 extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */ 807 extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ 808 GCC_SCANFLIKE(2,3); 809 extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */ 810 extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */ 811 extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */ 812 extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */ 813 extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */ 814 extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */ 815 extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ 816 extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */ 817 extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */ 818 819 /* 820 * These are also declared in <term.h>: 821 */ 822 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ 823 extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */ 824 extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */ 825 extern NCURSES_EXPORT(int) putp (const char *); /* implemented */ 826 827 #if NCURSES_TPARM_VARARGS 828 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */ 829 #else 830 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */ 831 extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ 832 #endif 833 834 /* 835 * These functions are not in X/Open, but we use them in macro definitions: 836 */ 837 extern NCURSES_EXPORT(int) getattrs (const WINDOW *); /* generated */ 838 extern NCURSES_EXPORT(int) getcurx (const WINDOW *); /* generated */ 839 extern NCURSES_EXPORT(int) getcury (const WINDOW *); /* generated */ 840 extern NCURSES_EXPORT(int) getbegx (const WINDOW *); /* generated */ 841 extern NCURSES_EXPORT(int) getbegy (const WINDOW *); /* generated */ 842 extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */ 843 extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */ 844 extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */ 845 extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */ 846 847 /* 848 * vid_attr() was implemented originally based on a draft of X/Open curses. 849 */ 850 #if !NCURSES_WIDECHAR 851 #define vid_attr(a,pair,opts) vidattr(a) 852 #endif 853 854 /* 855 * These functions are extensions - not in X/Open Curses. 856 */ 857 #if 1 858 #undef NCURSES_EXT_FUNCS 859 #define NCURSES_EXT_FUNCS 20081102 860 typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *); 861 typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *); 862 extern NCURSES_EXPORT(bool) is_term_resized (int, int); 863 extern NCURSES_EXPORT(char *) keybound (int, int); 864 extern NCURSES_EXPORT(const char *) curses_version (void); 865 extern NCURSES_EXPORT(int) assume_default_colors (int, int); 866 extern NCURSES_EXPORT(int) define_key (const char *, int); 867 extern NCURSES_EXPORT(int) key_defined (const char *); 868 extern NCURSES_EXPORT(int) keyok (int, bool); 869 extern NCURSES_EXPORT(int) resize_term (int, int); 870 extern NCURSES_EXPORT(int) resizeterm (int, int); 871 extern NCURSES_EXPORT(int) set_escdelay (int); 872 extern NCURSES_EXPORT(int) set_tabsize (int); 873 extern NCURSES_EXPORT(int) use_default_colors (void); 874 extern NCURSES_EXPORT(int) use_extended_names (bool); 875 extern NCURSES_EXPORT(int) use_legacy_coding (int); 876 extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *); 877 extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *); 878 extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); 879 extern NCURSES_EXPORT(void) nofilter(void); 880 881 /* 882 * These extensions provide access to information stored in the WINDOW even 883 * when NCURSES_OPAQUE is set: 884 */ 885 extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* generated */ 886 extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* generated */ 887 extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* generated */ 888 extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* generated */ 889 extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* generated */ 890 extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* generated */ 891 extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* generated */ 892 extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* generated */ 893 extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */ 894 extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* generated */ 895 extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* generated */ 896 extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */ 897 898 #else 899 #define curses_version() NCURSES_VERSION 900 #endif 901 902 /* attributes */ 903 904 #define NCURSES_ATTR_SHIFT 8 905 #define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) 906 907 #define A_NORMAL (1U - 1U) 908 #define A_ATTRIBUTES NCURSES_BITS(~(1U - 1U),0) 909 #define A_CHARTEXT (NCURSES_BITS(1U,0) - 1U) 910 #define A_COLOR NCURSES_BITS(((1U) << 8) - 1U,0) 911 #define A_STANDOUT NCURSES_BITS(1U,8) 912 #define A_UNDERLINE NCURSES_BITS(1U,9) 913 #define A_REVERSE NCURSES_BITS(1U,10) 914 #define A_BLINK NCURSES_BITS(1U,11) 915 #define A_DIM NCURSES_BITS(1U,12) 916 #define A_BOLD NCURSES_BITS(1U,13) 917 #define A_ALTCHARSET NCURSES_BITS(1U,14) 918 #define A_INVIS NCURSES_BITS(1U,15) 919 #define A_PROTECT NCURSES_BITS(1U,16) 920 #define A_HORIZONTAL NCURSES_BITS(1U,17) 921 #define A_LEFT NCURSES_BITS(1U,18) 922 #define A_LOW NCURSES_BITS(1U,19) 923 #define A_RIGHT NCURSES_BITS(1U,20) 924 #define A_TOP NCURSES_BITS(1U,21) 925 #define A_VERTICAL NCURSES_BITS(1U,22) 926 927 /* 928 * Most of the pseudo functions are macros that either provide compatibility 929 * with older versions of curses, or provide inline functionality to improve 930 * performance. 931 */ 932 933 /* 934 * These pseudo functions are always implemented as macros: 935 */ 936 937 #define getyx(win,y,x) (y = getcury(win), x = getcurx(win)) 938 #define getbegyx(win,y,x) (y = getbegy(win), x = getbegx(win)) 939 #define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win)) 940 #define getparyx(win,y,x) (y = getpary(win), x = getparx(win)) 941 942 #define getsyx(y,x) do { if (newscr) { \ 943 if (is_leaveok(newscr)) \ 944 (y) = (x) = -1; \ 945 else \ 946 getyx(newscr,(y), (x)); \ 947 } \ 948 } while(0) 949 950 #define setsyx(y,x) do { if (newscr) { \ 951 if ((y) == -1 && (x) == -1) \ 952 leaveok(newscr, TRUE); \ 953 else { \ 954 leaveok(newscr, FALSE); \ 955 wmove(newscr, (y), (x)); \ 956 } \ 957 } \ 958 } while(0) 959 960 #ifndef NCURSES_NOMACROS 961 962 /* 963 * These miscellaneous pseudo functions are provided for compatibility: 964 */ 965 966 #define wgetstr(w, s) wgetnstr(w, s, -1) 967 #define getnstr(s, n) wgetnstr(stdscr, s, n) 968 969 #define setterm(term) setupterm(term, 1, (int *)0) 970 971 #define fixterm() reset_prog_mode() 972 #define resetterm() reset_shell_mode() 973 #define saveterm() def_prog_mode() 974 #define crmode() cbreak() 975 #define nocrmode() nocbreak() 976 #define gettmode() 977 978 /* It seems older SYSV curses versions define these */ 979 #if !NCURSES_OPAQUE 980 #define getattrs(win) ((win) ? (win)->_attrs : A_NORMAL) 981 #define getcurx(win) ((win) ? (win)->_curx : ERR) 982 #define getcury(win) ((win) ? (win)->_cury : ERR) 983 #define getbegx(win) ((win) ? (win)->_begx : ERR) 984 #define getbegy(win) ((win) ? (win)->_begy : ERR) 985 #define getmaxx(win) ((win) ? ((win)->_maxx + 1) : ERR) 986 #define getmaxy(win) ((win) ? ((win)->_maxy + 1) : ERR) 987 #define getparx(win) ((win) ? (win)->_parx : ERR) 988 #define getpary(win) ((win) ? (win)->_pary : ERR) 989 #endif /* NCURSES_OPAQUE */ 990 991 #define wstandout(win) (wattrset(win,A_STANDOUT)) 992 #define wstandend(win) (wattrset(win,A_NORMAL)) 993 994 #define wattron(win,at) wattr_on(win, NCURSES_CAST(attr_t, at), NULL) 995 #define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL) 996 997 #if !NCURSES_OPAQUE 998 #if NCURSES_WIDECHAR && 0 999 #define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \ 1000 (win)->_attrs = (at)) 1001 #else 1002 #define wattrset(win,at) ((win)->_attrs = (at)) 1003 #endif 1004 #endif /* NCURSES_OPAQUE */ 1005 1006 #define scroll(win) wscrl(win,1) 1007 1008 #define touchwin(win) wtouchln((win), 0, getmaxy(win), 1) 1009 #define touchline(win, s, c) wtouchln((win), s, c, 1) 1010 #define untouchwin(win) wtouchln((win), 0, getmaxy(win), 0) 1011 1012 #define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0) 1013 #define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) 1014 #define hline(ch, n) whline(stdscr, ch, n) 1015 #define vline(ch, n) wvline(stdscr, ch, n) 1016 1017 #define winstr(w, s) winnstr(w, s, -1) 1018 #define winchstr(w, s) winchnstr(w, s, -1) 1019 #define winsstr(w, s) winsnstr(w, s, -1) 1020 1021 #if !NCURSES_OPAQUE 1022 #define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1) 1023 #endif /* NCURSES_OPAQUE */ 1024 1025 #define waddstr(win,str) waddnstr(win,str,-1) 1026 #define waddchstr(win,str) waddchnstr(win,str,-1) 1027 1028 /* 1029 * These apply to the first 256 color pairs. 1030 */ 1031 #define COLOR_PAIR(n) NCURSES_BITS(n, 0) 1032 #define PAIR_NUMBER(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) 1033 1034 /* 1035 * pseudo functions for standard screen 1036 */ 1037 1038 #define addch(ch) waddch(stdscr,ch) 1039 #define addchnstr(str,n) waddchnstr(stdscr,str,n) 1040 #define addchstr(str) waddchstr(stdscr,str) 1041 #define addnstr(str,n) waddnstr(stdscr,str,n) 1042 #define addstr(str) waddnstr(stdscr,str,-1) 1043 #define attroff(at) wattroff(stdscr,at) 1044 #define attron(at) wattron(stdscr,at) 1045 #define attrset(at) wattrset(stdscr,at) 1046 #define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o) 1047 #define attr_off(a,o) wattr_off(stdscr,a,o) 1048 #define attr_on(a,o) wattr_on(stdscr,a,o) 1049 #define attr_set(a,c,o) wattr_set(stdscr,a,c,o) 1050 #define bkgd(ch) wbkgd(stdscr,ch) 1051 #define bkgdset(ch) wbkgdset(stdscr,ch) 1052 #define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) 1053 #define clear() wclear(stdscr) 1054 #define clrtobot() wclrtobot(stdscr) 1055 #define clrtoeol() wclrtoeol(stdscr) 1056 #define color_set(c,o) wcolor_set(stdscr,c,o) 1057 #define delch() wdelch(stdscr) 1058 #define deleteln() winsdelln(stdscr,-1) 1059 #define echochar(c) wechochar(stdscr,c) 1060 #define erase() werase(stdscr) 1061 #define getch() wgetch(stdscr) 1062 #define getstr(str) wgetstr(stdscr,str) 1063 #define inch() winch(stdscr) 1064 #define inchnstr(s,n) winchnstr(stdscr,s,n) 1065 #define inchstr(s) winchstr(stdscr,s) 1066 #define innstr(s,n) winnstr(stdscr,s,n) 1067 #define insch(c) winsch(stdscr,c) 1068 #define insdelln(n) winsdelln(stdscr,n) 1069 #define insertln() winsdelln(stdscr,1) 1070 #define insnstr(s,n) winsnstr(stdscr,s,n) 1071 #define insstr(s) winsstr(stdscr,s) 1072 #define instr(s) winstr(stdscr,s) 1073 #define move(y,x) wmove(stdscr,y,x) 1074 #define refresh() wrefresh(stdscr) 1075 #define scrl(n) wscrl(stdscr,n) 1076 #define setscrreg(t,b) wsetscrreg(stdscr,t,b) 1077 #define standend() wstandend(stdscr) 1078 #define standout() wstandout(stdscr) 1079 #define timeout(delay) wtimeout(stdscr,delay) 1080 #define wdeleteln(win) winsdelln(win,-1) 1081 #define winsertln(win) winsdelln(win,1) 1082 1083 /* 1084 * mv functions 1085 */ 1086 1087 #define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) 1088 #define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) 1089 #define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) 1090 #define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) 1091 #define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) 1092 #define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) 1093 #define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) 1094 #define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) 1095 #define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) 1096 #define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) 1097 #define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) 1098 #define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win)) 1099 #define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n)) 1100 #define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s)) 1101 #define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) 1102 #define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) 1103 #define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n)) 1104 #define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s)) 1105 #define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s)) 1106 #define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) 1107 1108 #define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) 1109 #define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n) 1110 #define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str) 1111 #define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) 1112 #define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) 1113 #define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) 1114 #define mvdelch(y,x) mvwdelch(stdscr,y,x) 1115 #define mvgetch(y,x) mvwgetch(stdscr,y,x) 1116 #define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n) 1117 #define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) 1118 #define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n) 1119 #define mvinch(y,x) mvwinch(stdscr,y,x) 1120 #define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n) 1121 #define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s) 1122 #define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) 1123 #define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) 1124 #define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) 1125 #define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) 1126 #define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s) 1127 #define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n) 1128 1129 /* 1130 * Some wide-character functions can be implemented without the extensions. 1131 */ 1132 #if !NCURSES_OPAQUE 1133 #define getbkgd(win) ((win)->_bkgd) 1134 #endif /* NCURSES_OPAQUE */ 1135 1136 #define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a)) 1137 #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) 1138 1139 #if !NCURSES_OPAQUE 1140 #if NCURSES_WIDECHAR && 0 1141 #define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \ 1142 (win)->_color = (p), \ 1143 OK) 1144 #define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ 1145 (void)((p) != (void *)0 && (*(p) = (win)->_color)), \ 1146 OK) 1147 #else 1148 #define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK) 1149 #define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ 1150 (void)((p) != (void *)0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \ 1151 OK) 1152 #endif 1153 #endif /* NCURSES_OPAQUE */ 1154 1155 /* 1156 * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use 1157 * varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to 1158 * use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already 1159 * use stdarg.h, so... 1160 */ 1161 #define vw_printw vwprintw 1162 #define vw_scanw vwscanw 1163 1164 /* 1165 * Export fallback function for use in C++ binding. 1166 */ 1167 #if !1 1168 #define vsscanf(a,b,c) _nc_vsscanf(a,b,c) 1169 NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); 1170 #endif 1171 1172 /* 1173 * These macros are extensions - not in X/Open Curses. 1174 */ 1175 #if 1 1176 #if !NCURSES_OPAQUE 1177 #define is_cleared(win) ((win)->_clear) 1178 #define is_idcok(win) ((win)->_idcok) 1179 #define is_idlok(win) ((win)->_idlok) 1180 #define is_immedok(win) ((win)->_immed) 1181 #define is_keypad(win) ((win)->_use_keypad) 1182 #define is_leaveok(win) ((win)->_leaveok) 1183 #define is_nodelay(win) ((win)->_delay == 0) 1184 #define is_notimeout(win) ((win)->_notimeout) 1185 #define is_scrollok(win) ((win)->_scroll) 1186 #define is_syncok(win) ((win)->_sync) 1187 #define wgetparent(win) ((win) ? (win)->_parent : 0) 1188 #define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) 1189 #endif 1190 #endif 1191 1192 #endif /* NCURSES_NOMACROS */ 1193 1194 /* 1195 * Public variables. 1196 * 1197 * Notes: 1198 * a. ESCDELAY was an undocumented feature under AIX curses. 1199 * It gives the ESC expire time in milliseconds. 1200 * b. ttytype is needed for backward compatibility 1201 */ 1202 #if 0 1203 1204 NCURSES_WRAPPED_VAR(WINDOW *, curscr); 1205 NCURSES_WRAPPED_VAR(WINDOW *, newscr); 1206 NCURSES_WRAPPED_VAR(WINDOW *, stdscr); 1207 NCURSES_WRAPPED_VAR(char *, ttytype); 1208 NCURSES_WRAPPED_VAR(int, COLORS); 1209 NCURSES_WRAPPED_VAR(int, COLOR_PAIRS); 1210 NCURSES_WRAPPED_VAR(int, COLS); 1211 NCURSES_WRAPPED_VAR(int, ESCDELAY); 1212 NCURSES_WRAPPED_VAR(int, LINES); 1213 NCURSES_WRAPPED_VAR(int, TABSIZE); 1214 1215 #define curscr NCURSES_PUBLIC_VAR(curscr()) 1216 #define newscr NCURSES_PUBLIC_VAR(newscr()) 1217 #define stdscr NCURSES_PUBLIC_VAR(stdscr()) 1218 #define ttytype NCURSES_PUBLIC_VAR(ttytype()) 1219 #define COLORS NCURSES_PUBLIC_VAR(COLORS()) 1220 #define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS()) 1221 #define COLS NCURSES_PUBLIC_VAR(COLS()) 1222 #define ESCDELAY NCURSES_PUBLIC_VAR(ESCDELAY()) 1223 #define LINES NCURSES_PUBLIC_VAR(LINES()) 1224 #define TABSIZE NCURSES_PUBLIC_VAR(TABSIZE()) 1225 1226 #else 1227 1228 extern NCURSES_EXPORT_VAR(WINDOW *) curscr; 1229 extern NCURSES_EXPORT_VAR(WINDOW *) newscr; 1230 extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; 1231 extern NCURSES_EXPORT_VAR(char) ttytype[]; 1232 extern NCURSES_EXPORT_VAR(int) COLORS; 1233 extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; 1234 extern NCURSES_EXPORT_VAR(int) COLS; 1235 extern NCURSES_EXPORT_VAR(int) ESCDELAY; 1236 extern NCURSES_EXPORT_VAR(int) LINES; 1237 extern NCURSES_EXPORT_VAR(int) TABSIZE; 1238 1239 #endif 1240 1241 /* 1242 * Pseudo-character tokens outside ASCII range. The curses wgetch() function 1243 * will return any given one of these only if the corresponding k- capability 1244 * is defined in your terminal's terminfo entry. 1245 * 1246 * Some keys (KEY_A1, etc) are arranged like this: 1247 * a1 up a3 1248 * left b2 right 1249 * c1 down c3 1250 * 1251 * A few key codes do not depend upon the terminfo entry. 1252 */ 1253 #define KEY_CODE_YES 0400 /* A wchar_t contains a key code */ 1254 #define KEY_MIN 0401 /* Minimum curses key */ 1255 #define KEY_BREAK 0401 /* Break key (unreliable) */ 1256 #define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ 1257 #define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ 1258 /* 1259 * These definitions were generated by ./MKkey_defs.sh ./Caps 1260 */ 1261 #define KEY_DOWN 0402 /* down-arrow key */ 1262 #define KEY_UP 0403 /* up-arrow key */ 1263 #define KEY_LEFT 0404 /* left-arrow key */ 1264 #define KEY_RIGHT 0405 /* right-arrow key */ 1265 #define KEY_HOME 0406 /* home key */ 1266 #define KEY_BACKSPACE 0407 /* backspace key */ 1267 #define KEY_F0 0410 /* Function keys. Space for 64 */ 1268 #define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */ 1269 #define KEY_DL 0510 /* delete-line key */ 1270 #define KEY_IL 0511 /* insert-line key */ 1271 #define KEY_DC 0512 /* delete-character key */ 1272 #define KEY_IC 0513 /* insert-character key */ 1273 #define KEY_EIC 0514 /* sent by rmir or smir in insert mode */ 1274 #define KEY_CLEAR 0515 /* clear-screen or erase key */ 1275 #define KEY_EOS 0516 /* clear-to-end-of-screen key */ 1276 #define KEY_EOL 0517 /* clear-to-end-of-line key */ 1277 #define KEY_SF 0520 /* scroll-forward key */ 1278 #define KEY_SR 0521 /* scroll-backward key */ 1279 #define KEY_NPAGE 0522 /* next-page key */ 1280 #define KEY_PPAGE 0523 /* previous-page key */ 1281 #define KEY_STAB 0524 /* set-tab key */ 1282 #define KEY_CTAB 0525 /* clear-tab key */ 1283 #define KEY_CATAB 0526 /* clear-all-tabs key */ 1284 #define KEY_ENTER 0527 /* enter/send key */ 1285 #define KEY_PRINT 0532 /* print key */ 1286 #define KEY_LL 0533 /* lower-left key (home down) */ 1287 #define KEY_A1 0534 /* upper left of keypad */ 1288 #define KEY_A3 0535 /* upper right of keypad */ 1289 #define KEY_B2 0536 /* center of keypad */ 1290 #define KEY_C1 0537 /* lower left of keypad */ 1291 #define KEY_C3 0540 /* lower right of keypad */ 1292 #define KEY_BTAB 0541 /* back-tab key */ 1293 #define KEY_BEG 0542 /* begin key */ 1294 #define KEY_CANCEL 0543 /* cancel key */ 1295 #define KEY_CLOSE 0544 /* close key */ 1296 #define KEY_COMMAND 0545 /* command key */ 1297 #define KEY_COPY 0546 /* copy key */ 1298 #define KEY_CREATE 0547 /* create key */ 1299 #define KEY_END 0550 /* end key */ 1300 #define KEY_EXIT 0551 /* exit key */ 1301 #define KEY_FIND 0552 /* find key */ 1302 #define KEY_HELP 0553 /* help key */ 1303 #define KEY_MARK 0554 /* mark key */ 1304 #define KEY_MESSAGE 0555 /* message key */ 1305 #define KEY_MOVE 0556 /* move key */ 1306 #define KEY_NEXT 0557 /* next key */ 1307 #define KEY_OPEN 0560 /* open key */ 1308 #define KEY_OPTIONS 0561 /* options key */ 1309 #define KEY_PREVIOUS 0562 /* previous key */ 1310 #define KEY_REDO 0563 /* redo key */ 1311 #define KEY_REFERENCE 0564 /* reference key */ 1312 #define KEY_REFRESH 0565 /* refresh key */ 1313 #define KEY_REPLACE 0566 /* replace key */ 1314 #define KEY_RESTART 0567 /* restart key */ 1315 #define KEY_RESUME 0570 /* resume key */ 1316 #define KEY_SAVE 0571 /* save key */ 1317 #define KEY_SBEG 0572 /* shifted begin key */ 1318 #define KEY_SCANCEL 0573 /* shifted cancel key */ 1319 #define KEY_SCOMMAND 0574 /* shifted command key */ 1320 #define KEY_SCOPY 0575 /* shifted copy key */ 1321 #define KEY_SCREATE 0576 /* shifted create key */ 1322 #define KEY_SDC 0577 /* shifted delete-character key */ 1323 #define KEY_SDL 0600 /* shifted delete-line key */ 1324 #define KEY_SELECT 0601 /* select key */ 1325 #define KEY_SEND 0602 /* shifted end key */ 1326 #define KEY_SEOL 0603 /* shifted clear-to-end-of-line key */ 1327 #define KEY_SEXIT 0604 /* shifted exit key */ 1328 #define KEY_SFIND 0605 /* shifted find key */ 1329 #define KEY_SHELP 0606 /* shifted help key */ 1330 #define KEY_SHOME 0607 /* shifted home key */ 1331 #define KEY_SIC 0610 /* shifted insert-character key */ 1332 #define KEY_SLEFT 0611 /* shifted left-arrow key */ 1333 #define KEY_SMESSAGE 0612 /* shifted message key */ 1334 #define KEY_SMOVE 0613 /* shifted move key */ 1335 #define KEY_SNEXT 0614 /* shifted next key */ 1336 #define KEY_SOPTIONS 0615 /* shifted options key */ 1337 #define KEY_SPREVIOUS 0616 /* shifted previous key */ 1338 #define KEY_SPRINT 0617 /* shifted print key */ 1339 #define KEY_SREDO 0620 /* shifted redo key */ 1340 #define KEY_SREPLACE 0621 /* shifted replace key */ 1341 #define KEY_SRIGHT 0622 /* shifted right-arrow key */ 1342 #define KEY_SRSUME 0623 /* shifted resume key */ 1343 #define KEY_SSAVE 0624 /* shifted save key */ 1344 #define KEY_SSUSPEND 0625 /* shifted suspend key */ 1345 #define KEY_SUNDO 0626 /* shifted undo key */ 1346 #define KEY_SUSPEND 0627 /* suspend key */ 1347 #define KEY_UNDO 0630 /* undo key */ 1348 #define KEY_MOUSE 0631 /* Mouse event has occurred */ 1349 #define KEY_RESIZE 0632 /* Terminal resize event */ 1350 #define KEY_EVENT 0633 /* We were interrupted by an event */ 1351 1352 #define KEY_MAX 0777 /* Maximum key value is 0633 */ 1353 /* $Id: curses.h,v 1.63 2022/10/10 09:03:08 nicm Exp $ */ 1354 /* 1355 * vile:cmode: 1356 * This file is part of ncurses, designed to be appended after curses.h.in 1357 * (see that file for the relevant copyright). 1358 */ 1359 #if NCURSES_WIDECHAR 1360 1361 extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; 1362 1363 #define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c]) 1364 1365 #define WACS_BSSB NCURSES_WACS('l') 1366 #define WACS_SSBB NCURSES_WACS('m') 1367 #define WACS_BBSS NCURSES_WACS('k') 1368 #define WACS_SBBS NCURSES_WACS('j') 1369 #define WACS_SBSS NCURSES_WACS('u') 1370 #define WACS_SSSB NCURSES_WACS('t') 1371 #define WACS_SSBS NCURSES_WACS('v') 1372 #define WACS_BSSS NCURSES_WACS('w') 1373 #define WACS_BSBS NCURSES_WACS('q') 1374 #define WACS_SBSB NCURSES_WACS('x') 1375 #define WACS_SSSS NCURSES_WACS('n') 1376 1377 #define WACS_ULCORNER WACS_BSSB 1378 #define WACS_LLCORNER WACS_SSBB 1379 #define WACS_URCORNER WACS_BBSS 1380 #define WACS_LRCORNER WACS_SBBS 1381 #define WACS_RTEE WACS_SBSS 1382 #define WACS_LTEE WACS_SSSB 1383 #define WACS_BTEE WACS_SSBS 1384 #define WACS_TTEE WACS_BSSS 1385 #define WACS_HLINE WACS_BSBS 1386 #define WACS_VLINE WACS_SBSB 1387 #define WACS_PLUS WACS_SSSS 1388 1389 #define WACS_S1 NCURSES_WACS('o') /* scan line 1 */ 1390 #define WACS_S9 NCURSES_WACS('s') /* scan line 9 */ 1391 #define WACS_DIAMOND NCURSES_WACS('`') /* diamond */ 1392 #define WACS_CKBOARD NCURSES_WACS('a') /* checker board */ 1393 #define WACS_DEGREE NCURSES_WACS('f') /* degree symbol */ 1394 #define WACS_PLMINUS NCURSES_WACS('g') /* plus/minus */ 1395 #define WACS_BULLET NCURSES_WACS('~') /* bullet */ 1396 1397 /* Teletype 5410v1 symbols */ 1398 #define WACS_LARROW NCURSES_WACS(',') /* arrow left */ 1399 #define WACS_RARROW NCURSES_WACS('+') /* arrow right */ 1400 #define WACS_DARROW NCURSES_WACS('.') /* arrow down */ 1401 #define WACS_UARROW NCURSES_WACS('-') /* arrow up */ 1402 #define WACS_BOARD NCURSES_WACS('h') /* board of squares */ 1403 #define WACS_LANTERN NCURSES_WACS('i') /* lantern symbol */ 1404 #define WACS_BLOCK NCURSES_WACS('0') /* solid square block */ 1405 1406 /* ncurses extensions */ 1407 #define WACS_S3 NCURSES_WACS('p') /* scan line 3 */ 1408 #define WACS_S7 NCURSES_WACS('r') /* scan line 7 */ 1409 #define WACS_LEQUAL NCURSES_WACS('y') /* less/equal */ 1410 #define WACS_GEQUAL NCURSES_WACS('z') /* greater/equal */ 1411 #define WACS_PI NCURSES_WACS('{') /* Pi */ 1412 #define WACS_NEQUAL NCURSES_WACS('|') /* not equal */ 1413 #define WACS_STERLING NCURSES_WACS('}') /* UK pound sign */ 1414 1415 /* 1416 * Function prototypes for wide-character operations. 1417 * 1418 * "generated" comments should include ":WIDEC" to make the corresponding 1419 * functions ifdef'd in lib_gen.c 1420 * 1421 * "implemented" comments do not need this marker. 1422 */ 1423 1424 extern NCURSES_EXPORT(int) add_wch (const cchar_t *); /* generated:WIDEC */ 1425 extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int); /* generated:WIDEC */ 1426 extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *); /* generated:WIDEC */ 1427 extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int); /* generated:WIDEC */ 1428 extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */ 1429 extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *); /* generated:WIDEC */ 1430 extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* generated:WIDEC */ 1431 extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */ 1432 extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* generated:WIDEC */ 1433 extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* generated:WIDEC */ 1434 extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* implemented */ 1435 extern NCURSES_EXPORT(int) get_wch (wint_t *); /* generated:WIDEC */ 1436 extern NCURSES_EXPORT(int) get_wstr (wint_t *); /* generated:WIDEC */ 1437 extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *); /* generated:WIDEC */ 1438 extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*); /* implemented */ 1439 extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* generated:WIDEC */ 1440 extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* generated:WIDEC */ 1441 extern NCURSES_EXPORT(int) in_wch (cchar_t *); /* generated:WIDEC */ 1442 extern NCURSES_EXPORT(int) in_wchnstr (cchar_t *, int); /* generated:WIDEC */ 1443 extern NCURSES_EXPORT(int) in_wchstr (cchar_t *); /* generated:WIDEC */ 1444 extern NCURSES_EXPORT(int) innwstr (wchar_t *, int); /* generated:WIDEC */ 1445 extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int); /* generated:WIDEC */ 1446 extern NCURSES_EXPORT(int) ins_wch (const cchar_t *); /* generated:WIDEC */ 1447 extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *); /* generated:WIDEC */ 1448 extern NCURSES_EXPORT(int) inwstr (wchar_t *); /* generated:WIDEC */ 1449 extern NCURSES_EXPORT(NCURSES_CONST char*) key_name (wchar_t); /* implemented */ 1450 extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* implemented */ 1451 extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *); /* generated:WIDEC */ 1452 extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */ 1453 extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *); /* generated:WIDEC */ 1454 extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ 1455 extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */ 1456 extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* generated:WIDEC */ 1457 extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* generated:WIDEC */ 1458 extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* generated:WIDEC */ 1459 extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ 1460 extern NCURSES_EXPORT(int) mvin_wch (int, int, cchar_t *); /* generated:WIDEC */ 1461 extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, cchar_t *, int); /* generated:WIDEC */ 1462 extern NCURSES_EXPORT(int) mvin_wchstr (int, int, cchar_t *); /* generated:WIDEC */ 1463 extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int); /* generated:WIDEC */ 1464 extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ 1465 extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *); /* generated:WIDEC */ 1466 extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *); /* generated:WIDEC */ 1467 extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *); /* generated:WIDEC */ 1468 extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ 1469 extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ 1470 extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */ 1471 extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ 1472 extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */ 1473 extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ 1474 extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ 1475 extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ 1476 extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */ 1477 extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */ 1478 extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ 1479 extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, cchar_t *,int); /* generated:WIDEC */ 1480 extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ 1481 extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int); /* generated:WIDEC */ 1482 extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */ 1483 extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ 1484 extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ 1485 extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *); /* generated:WIDEC */ 1486 extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */ 1487 extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *); /* implemented */ 1488 extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */ 1489 extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* implemented */ 1490 extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented */ 1491 extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented */ 1492 extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented */ 1493 extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented */ 1494 extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* generated:WIDEC */ 1495 extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* implemented */ 1496 extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* implemented */ 1497 extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *); /* generated:WIDEC */ 1498 extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int); /* implemented */ 1499 extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */ 1500 extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *); /* implemented */ 1501 extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *); /* implemented */ 1502 extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* implemented */ 1503 extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *); /* implemented */ 1504 extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *); /* implemented */ 1505 extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *); /* generated:WIDEC */ 1506 extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *); /* generated:WIDEC */ 1507 extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* implemented */ 1508 extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* implemented */ 1509 extern NCURSES_EXPORT(int) win_wch (WINDOW *, cchar_t *); /* implemented */ 1510 extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, cchar_t *, int); /* implemented */ 1511 extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, cchar_t *); /* generated:WIDEC */ 1512 extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* implemented */ 1513 extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* implemented */ 1514 extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* implemented */ 1515 extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* generated:WIDEC */ 1516 extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ 1517 extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ 1518 extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ 1519 1520 #ifndef NCURSES_NOMACROS 1521 1522 /* 1523 * XSI curses macros for XPG4 conformance. 1524 */ 1525 #define add_wch(c) wadd_wch(stdscr,c) 1526 #define add_wchnstr(str,n) wadd_wchnstr(stdscr,str,n) 1527 #define add_wchstr(str) wadd_wchstr(stdscr,str) 1528 #define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) 1529 #define addwstr(wstr) waddwstr(stdscr,wstr) 1530 #define bkgrnd(c) wbkgrnd(stdscr,c) 1531 #define bkgrndset(c) wbkgrndset(stdscr,c) 1532 #define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br) 1533 #define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) 1534 #define echo_wchar(c) wecho_wchar(stdscr,c) 1535 #define get_wch(c) wget_wch(stdscr,c) 1536 #define get_wstr(t) wget_wstr(stdscr,t) 1537 #define getbkgrnd(wch) wgetbkgrnd(stdscr,wch) 1538 #define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) 1539 #define hline_set(c,n) whline_set(stdscr,c,n) 1540 #define in_wch(c) win_wch(stdscr,c) 1541 #define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) 1542 #define in_wchstr(c) win_wchstr(stdscr,c) 1543 #define innwstr(c,n) winnwstr(stdscr,c,n) 1544 #define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) 1545 #define ins_wch(c) wins_wch(stdscr,c) 1546 #define ins_wstr(t) wins_wstr(stdscr,t) 1547 #define inwstr(c) winwstr(stdscr,c) 1548 #define vline_set(c,n) wvline_set(stdscr,c,n) 1549 #define wadd_wchstr(win,str) wadd_wchnstr(win,str,-1) 1550 #define waddwstr(win,wstr) waddnwstr(win,wstr,-1) 1551 #define wget_wstr(w,t) wgetn_wstr(w,t,-1) 1552 #define win_wchstr(w,c) win_wchnstr(w,c,-1) 1553 #define wins_wstr(w,t) wins_nwstr(w,t,-1) 1554 1555 #if !NCURSES_OPAQUE 1556 #define wgetbkgrnd(win,wch) (*wch = win->_bkgrnd, OK) 1557 #endif 1558 1559 #define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) 1560 #define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,y,x,s,n) 1561 #define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,y,x,s) 1562 #define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) 1563 #define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr) 1564 #define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) 1565 #define mvget_wstr(y,x,t) mvwget_wstr(stdscr,y,x,t) 1566 #define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) 1567 #define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) 1568 #define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) 1569 #define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) 1570 #define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,y,x,c) 1571 #define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) 1572 #define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) 1573 #define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) 1574 #define mvins_wstr(y,x,t) mvwins_wstr(stdscr,y,x,t) 1575 #define mvinwstr(y,x,c) mvwinwstr(stdscr,y,x,c) 1576 #define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) 1577 1578 #define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c)) 1579 #define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n)) 1580 #define mvwadd_wchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s)) 1581 #define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n)) 1582 #define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr)) 1583 #define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) 1584 #define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t)) 1585 #define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) 1586 #define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) 1587 #define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) 1588 #define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n)) 1589 #define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c)) 1590 #define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n)) 1591 #define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n)) 1592 #define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(win,c)) 1593 #define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t)) 1594 #define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winwstr(win,c)) 1595 #define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) 1596 1597 #endif /* NCURSES_NOMACROS */ 1598 1599 #if defined(TRACE) || defined(NCURSES_TEST) 1600 extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); 1601 extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *); 1602 #endif 1603 1604 #endif /* NCURSES_WIDECHAR */ 1605 /* $Id: curses.h,v 1.63 2022/10/10 09:03:08 nicm Exp $ */ 1606 /* 1607 * vile:cmode: 1608 * This file is part of ncurses, designed to be appended after curses.h.in 1609 * (see that file for the relevant copyright). 1610 */ 1611 1612 /* mouse interface */ 1613 1614 #if NCURSES_MOUSE_VERSION > 1 1615 #define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5)) 1616 #else 1617 #define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6)) 1618 #endif 1619 1620 #define NCURSES_BUTTON_RELEASED 001L 1621 #define NCURSES_BUTTON_PRESSED 002L 1622 #define NCURSES_BUTTON_CLICKED 004L 1623 #define NCURSES_DOUBLE_CLICKED 010L 1624 #define NCURSES_TRIPLE_CLICKED 020L 1625 #define NCURSES_RESERVED_EVENT 040L 1626 1627 /* event masks */ 1628 #define BUTTON1_RELEASED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED) 1629 #define BUTTON1_PRESSED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED) 1630 #define BUTTON1_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED) 1631 #define BUTTON1_DOUBLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED) 1632 #define BUTTON1_TRIPLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED) 1633 1634 #define BUTTON2_RELEASED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED) 1635 #define BUTTON2_PRESSED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED) 1636 #define BUTTON2_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED) 1637 #define BUTTON2_DOUBLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED) 1638 #define BUTTON2_TRIPLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED) 1639 1640 #define BUTTON3_RELEASED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED) 1641 #define BUTTON3_PRESSED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED) 1642 #define BUTTON3_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED) 1643 #define BUTTON3_DOUBLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED) 1644 #define BUTTON3_TRIPLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED) 1645 1646 #define BUTTON4_RELEASED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED) 1647 #define BUTTON4_PRESSED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED) 1648 #define BUTTON4_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED) 1649 #define BUTTON4_DOUBLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED) 1650 #define BUTTON4_TRIPLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED) 1651 1652 /* 1653 * In 32 bits the version-1 scheme does not provide enough space for a 5th 1654 * button, unless we choose to change the ABI by omitting the reserved-events. 1655 */ 1656 #if NCURSES_MOUSE_VERSION > 1 1657 1658 #define BUTTON5_RELEASED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED) 1659 #define BUTTON5_PRESSED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED) 1660 #define BUTTON5_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED) 1661 #define BUTTON5_DOUBLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED) 1662 #define BUTTON5_TRIPLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED) 1663 1664 #define BUTTON_CTRL NCURSES_MOUSE_MASK(6, 0001L) 1665 #define BUTTON_SHIFT NCURSES_MOUSE_MASK(6, 0002L) 1666 #define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L) 1667 #define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L) 1668 1669 #else 1670 1671 #define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT) 1672 #define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT) 1673 #define BUTTON3_RESERVED_EVENT NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT) 1674 #define BUTTON4_RESERVED_EVENT NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT) 1675 1676 #define BUTTON_CTRL NCURSES_MOUSE_MASK(5, 0001L) 1677 #define BUTTON_SHIFT NCURSES_MOUSE_MASK(5, 0002L) 1678 #define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L) 1679 #define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L) 1680 1681 #endif 1682 1683 #define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1) 1684 1685 /* macros to extract single event-bits from masks */ 1686 #define BUTTON_RELEASE(e, x) ((e) & NCURSES_MOUSE_MASK(x, 001)) 1687 #define BUTTON_PRESS(e, x) ((e) & NCURSES_MOUSE_MASK(x, 002)) 1688 #define BUTTON_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 004)) 1689 #define BUTTON_DOUBLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 010)) 1690 #define BUTTON_TRIPLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 020)) 1691 #define BUTTON_RESERVED_EVENT(e, x) ((e) & NCURSES_MOUSE_MASK(x, 040)) 1692 1693 typedef struct 1694 { 1695 short id; /* ID to distinguish multiple devices */ 1696 int x, y, z; /* event coordinates (character-cell) */ 1697 mmask_t bstate; /* button state bits */ 1698 } 1699 MEVENT; 1700 1701 extern NCURSES_EXPORT(int) getmouse (MEVENT *); 1702 extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); 1703 extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); 1704 extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); 1705 extern NCURSES_EXPORT(int) mouseinterval (int); 1706 extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); 1707 extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ 1708 1709 #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) 1710 1711 /* other non-XSI functions */ 1712 1713 extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ 1714 extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ 1715 1716 /* Debugging : use with libncurses_g.a */ 1717 1718 extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); 1719 extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); 1720 extern NCURSES_EXPORT(char *) _traceattr (attr_t); 1721 extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); 1722 extern NCURSES_EXPORT(char *) _nc_tracebits (void); 1723 extern NCURSES_EXPORT(char *) _tracechar (int); 1724 extern NCURSES_EXPORT(char *) _tracechtype (chtype); 1725 extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); 1726 #if NCURSES_WIDECHAR 1727 #define _tracech_t _tracecchar_t 1728 extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); 1729 #define _tracech_t2 _tracecchar_t2 1730 extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); 1731 #else 1732 #define _tracech_t _tracechtype 1733 #define _tracech_t2 _tracechtype2 1734 #endif 1735 extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); 1736 extern NCURSES_EXPORT(void) trace (const unsigned int); 1737 1738 /* trace masks */ 1739 #define TRACE_DISABLE 0x0000 /* turn off tracing */ 1740 #define TRACE_TIMES 0x0001 /* trace user and system times of updates */ 1741 #define TRACE_TPUTS 0x0002 /* trace tputs calls */ 1742 #define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ 1743 #define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ 1744 #define TRACE_CHARPUT 0x0010 /* trace all character outputs */ 1745 #define TRACE_ORDINARY 0x001F /* trace all update actions */ 1746 #define TRACE_CALLS 0x0020 /* trace all curses calls */ 1747 #define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ 1748 #define TRACE_IEVENT 0x0080 /* trace low-level input processing */ 1749 #define TRACE_BITS 0x0100 /* trace state of TTY control bits */ 1750 #define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ 1751 #define TRACE_CCALLS 0x0400 /* trace per-character calls */ 1752 #define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ 1753 #define TRACE_ATTRS 0x1000 /* trace attribute updates */ 1754 1755 #define TRACE_SHIFT 13 /* number of bits in the trace masks */ 1756 #define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */ 1757 1758 #if defined(TRACE) || defined(NCURSES_TEST) 1759 extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ 1760 extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); 1761 #define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ 1762 #define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ 1763 #define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ 1764 #define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ 1765 #endif 1766 1767 #ifdef __cplusplus 1768 1769 #ifndef NCURSES_NOMACROS 1770 1771 /* these names conflict with STL */ 1772 #undef box 1773 #undef clear 1774 #undef erase 1775 #undef move 1776 #undef refresh 1777 1778 #endif /* NCURSES_NOMACROS */ 1779 1780 } 1781 #endif 1782 1783 #endif /* __NCURSES_H */ 1784