PageRenderTime 127ms CodeModel.GetById 66ms app.highlight 51ms RepoModel.GetById 1ms app.codeStats 0ms

/pdcurses/curses.h

http://ghostcb.googlecode.com/
C++ Header | 1384 lines | 1089 code | 135 blank | 160 comment | 7 complexity | ac91e3f8ae8de569c152f97bb39c1d31 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

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

Large files files are truncated, but you can click here to view the full file