[BACK]Return to curses.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcurses

Annotation of src/lib/libcurses/curses.h, Revision 1.40

1.40    ! blymn       1: /*     $NetBSD: curses.h,v 1.39 2000/04/20 13:12:14 blymn Exp $        */
1.18      mikel       2:
1.1       cgd         3: /*
1.13      cgd         4:  * Copyright (c) 1981, 1993, 1994
1.7       cgd         5:  *     The Regents of the University of California.  All rights reserved.
1.1       cgd         6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  * 3. All advertising materials mentioning features or use of this software
                     16:  *    must display the following acknowledgement:
                     17:  *     This product includes software developed by the University of
                     18:  *     California, Berkeley and its contributors.
                     19:  * 4. Neither the name of the University nor the names of its contributors
                     20:  *    may be used to endorse or promote products derived from this software
                     21:  *    without specific prior written permission.
                     22:  *
                     23:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     24:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     25:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     26:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     27:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     28:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     29:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     30:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     31:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     32:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     33:  * SUCH DAMAGE.
                     34:  *
1.21      perry      35:  *     @(#)curses.h    8.5 (Berkeley) 4/29/95
1.1       cgd        36:  */
                     37:
1.4       mycroft    38: #ifndef _CURSES_H_
                     39: #define        _CURSES_H_
1.1       cgd        40:
1.22      mrg        41: #include <sys/types.h>
                     42: #include <sys/cdefs.h>
1.30      blymn      43: #include <wchar.h>
1.22      mrg        44:
1.4       mycroft    45: #include <stdio.h>
1.20      lukem      46: #include <termcap.h>
1.1       cgd        47:
1.4       mycroft    48: /*
1.31      jdc        49:  * attr_t must be the same size as wchar_t (see <wchar.h>) to avoid padding
                     50:  * in __LDATA.
1.4       mycroft    51:  */
1.30      blymn      52: typedef wchar_t        chtype;
                     53: typedef wchar_t        attr_t;
                     54: typedef        char    bool;
1.1       cgd        55:
1.4       mycroft    56: #ifndef TRUE
1.22      mrg        57: #define        TRUE    (/*CONSTCOND*/1)
1.4       mycroft    58: #endif
                     59: #ifndef FALSE
1.22      mrg        60: #define        FALSE   (/*CONSTCOND*/0)
1.4       mycroft    61: #endif
1.1       cgd        62:
1.30      blymn      63: /*
                     64:  * The following #defines and #includes are present for backward
                     65:  * compatibility only.  They should not be used in future code.
                     66:  *
                     67:  * START BACKWARD COMPATIBILITY ONLY.
                     68:  */
                     69: #ifndef _CURSES_PRIVATE
                     70:
1.4       mycroft    71: #define        _puts(s)        tputs(s, 0, __cputchar)
                     72: #define        _putchar(c)     __cputchar(c)
1.1       cgd        73:
1.4       mycroft    74: /* Old-style terminal modes access. */
1.7       cgd        75: #define        baudrate()      (cfgetospeed(&__baset))
1.4       mycroft    76: #define        crmode()        cbreak()
1.7       cgd        77: #define        erasechar()     (__baset.c_cc[VERASE])
                     78: #define        killchar()      (__baset.c_cc[VKILL])
1.4       mycroft    79: #define        nocrmode()      nocbreak()
1.7       cgd        80: #define        ospeed          (cfgetospeed(&__baset))
1.4       mycroft    81: #endif /* _CURSES_PRIVATE */
                     82:
1.7       cgd        83: extern char     GT;                    /* Gtty indicates tabs. */
                     84: extern char     NONL;                  /* Term can't hack LF doing a CR. */
                     85: extern char     UPPERCASE;             /* Terminal is uppercase only. */
                     86:
1.4       mycroft    87: extern int      My_term;               /* Use Def_term regardless. */
1.37      blymn      88: extern const char      *Def_term;              /* Default terminal type. */
1.4       mycroft    89:
                     90: /* Termcap capabilities. */
1.31      jdc        91: extern char    AM, BE, BS, CA, CC, DA, EO, HC, HL, IN, MI, MS, NC, NS,
                     92:                OS, PC, UL, XB, XN, XT, XS, XX;
                     93: extern int     PA, cO, nc;
1.30      blymn      94: extern char    *AC, *AE, *AL, *AS, *BC, *BL, *BT, *CD, *CE, *CL, *CM,
                     95:                *CR, *CS, *DC, *DL, *DM, *DO, *Ea, *ED, *EI, *K0, *K1,
                     96:                *K2, *K3, *K4, *K5, *K6, *K7, *K8, *K9, *HO, *IC, *IM,
                     97:                *IP, *KD, *KE, *KH, *KL, *KR, *KS, *KU, *LL, *MA, *MB,
1.40    ! blymn      98:                *MD, *ME, *MH, *MK, *MM, *MO, *MP, *MR, *ND, *NL, *OC,
        !            99:                *OP, *RC, *SC, *SE, *SF, *SO, *SP, *SR, *TA, *TE, *TI,
        !           100:                *UC, *UE, *UP, *US, *VB, *VI, *VS, *VE, *ab, *af, *al, *dl,
        !           101:                *iC, *iP, *sB, *sF, *sf, *sr, *AL_PARM, *DL_PARM, *UP_PARM,
        !           102:                *DOWN_PARM, *LEFT_PARM, *RIGHT_PARM;
1.4       mycroft   103:
1.7       cgd       104: /* END BACKWARD COMPATIBILITY ONLY. */
                    105:
1.22      mrg       106: /* symbols for values returned by getch in keypad mode */
                    107: #define    KEY_MIN        0x101    /* minimum extended key value */
                    108: #define    KEY_BREAK      0x101    /* break key */
                    109: #define    KEY_DOWN       0x102    /* down arrow */
                    110: #define    KEY_UP         0x103    /* up arrow */
                    111: #define    KEY_LEFT       0x104    /* left arrow */
                    112: #define    KEY_RIGHT      0x105    /* right arrow*/
                    113: #define    KEY_HOME       0x106    /* home key */
                    114: #define    KEY_BACKSPACE  0x107    /* Backspace */
                    115:
                    116: /* First function key (block of 64 follow) */
1.24      simonb    117: #define    KEY_F0         0x108
1.22      mrg       118: /* Function defining other function key values*/
1.24      simonb    119: #define    KEY_F(n)       (KEY_F0+(n))
1.22      mrg       120:
                    121: #define    KEY_DL         0x148    /* Delete Line */
                    122: #define    KEY_IL         0x149    /* Insert Line*/
                    123: #define    KEY_DC         0x14A    /* Delete Character */
                    124: #define    KEY_IC         0x14B    /* Insert Character */
                    125: #define    KEY_EIC        0x14C    /* Exit Insert Char mode */
                    126: #define    KEY_CLEAR      0x14D    /* Clear screen */
                    127: #define    KEY_EOS        0x14E    /* Clear to end of screen */
                    128: #define    KEY_EOL        0x14F    /* Clear to end of line */
                    129: #define    KEY_SF         0x150    /* Scroll one line forward */
                    130: #define    KEY_SR         0x151    /* Scroll one line back */
                    131: #define    KEY_NPAGE      0x152    /* Next Page */
                    132: #define    KEY_PPAGE      0x153    /* Prev Page */
                    133: #define    KEY_STAB       0x154    /* Set Tab */
                    134: #define    KEY_CTAB       0x155    /* Clear Tab */
                    135: #define    KEY_CATAB      0x156    /* Clear All Tabs */
                    136: #define    KEY_ENTER      0x157    /* Enter or Send */
                    137: #define    KEY_SRESET     0x158    /* Soft Reset */
                    138: #define    KEY_RESET      0x159    /* Hard Reset */
                    139: #define    KEY_PRINT      0x15A    /* Print */
                    140: #define    KEY_LL         0x15B    /* Home Down */
                    141:
                    142: /*
                    143:  * "Keypad" keys arranged like this:
                    144:  *
                    145:  *  A1   up  A3
                    146:  * left  B2 right
                    147:  *  C1  down C3
                    148:  *
                    149:  */
                    150: #define    KEY_A1         0x15C    /* Keypad upper left */
                    151: #define    KEY_A3         0x15D    /* Keypad upper right */
                    152: #define    KEY_B2         0x15E    /* Keypad centre key */
                    153: #define    KEY_C1         0x15F    /* Keypad lower left */
                    154: #define    KEY_C3         0x160    /* Keypad lower right */
                    155:
                    156: #define    KEY_BTAB       0x161    /* Back Tab */
                    157: #define    KEY_BEG        0x162    /* Begin key */
                    158: #define    KEY_CANCEL     0x163    /* Cancel key */
                    159: #define    KEY_CLOSE      0x164    /* Close Key */
                    160: #define    KEY_COMMAND    0x165    /* Command Key */
                    161: #define    KEY_COPY       0x166    /* Copy key */
                    162: #define    KEY_CREATE     0x167    /* Create key */
                    163: #define    KEY_END        0x168    /* End key */
                    164: #define    KEY_EXIT       0x169    /* Exit key */
                    165: #define    KEY_FIND       0x16A    /* Find key */
                    166: #define    KEY_HELP       0x16B    /* Help key */
                    167: #define    KEY_MARK       0x16C    /* Mark key */
                    168: #define    KEY_MESSAGE    0x16D    /* Message key */
                    169: #define    KEY_MOVE       0x16E    /* Move key */
                    170: #define    KEY_NEXT       0x16F    /* Next Object key */
                    171: #define    KEY_OPEN       0x170    /* Open key */
                    172: #define    KEY_OPTIONS    0x171    /* Options key */
                    173: #define    KEY_PREVIOUS   0x172    /* Previous Object key */
                    174: #define    KEY_REDO       0x173    /* Redo key */
                    175: #define    KEY_REFERENCE  0x174    /* Ref Key */
                    176: #define    KEY_REFRESH    0x175    /* Refresh key */
                    177: #define    KEY_REPLACE    0x176    /* Replace key */
                    178: #define    KEY_RESTART    0x177    /* Restart key */
                    179: #define    KEY_RESUME     0x178    /* Resume key */
                    180: #define    KEY_SAVE       0x179    /* Save key */
                    181: #define    KEY_SBEG       0x17A    /* Shift begin key */
                    182: #define    KEY_SCANCEL    0x17B    /* Shift Cancel key */
                    183: #define    KEY_SCOMMAND   0x17C    /* Shift Command key */
                    184: #define    KEY_SCOPY      0x17D    /* Shift Copy key */
                    185: #define    KEY_SCREATE    0x17E    /* Shift Create key */
                    186: #define    KEY_SDC        0x17F    /* Shift Delete Character */
                    187: #define    KEY_SDL        0x180    /* Shift Delete Line */
                    188: #define    KEY_SELECT     0x181    /* Select key */
                    189: #define    KEY_SEND       0x182    /* Send key */
                    190: #define    KEY_SEOL       0x183    /* Shift Clear Line key */
                    191: #define    KEY_SEXIT      0x184    /* Shift Exit key */
                    192: #define    KEY_SFIND      0x185    /* Shift Find key */
                    193: #define    KEY_SHELP      0x186    /* Shift Help key */
                    194: #define    KEY_SHOME      0x187    /* Shift Home key */
                    195: #define    KEY_SIC        0x188    /* Shift Input key */
                    196: #define    KEY_SLEFT      0x189    /* Shift Left Arrow key */
                    197: #define    KEY_SMESSAGE   0x18A    /* Shift Message key */
                    198: #define    KEY_SMOVE      0x18B    /* Shift Move key */
                    199: #define    KEY_SNEXT      0x18C    /* Shift Next key */
                    200: #define    KEY_SOPTIONS   0x18D    /* Shift Options key */
                    201: #define    KEY_SPREVIOUS  0x18E    /* Shift Previous key */
                    202: #define    KEY_SPRINT     0x18F    /* Shift Print key */
                    203: #define    KEY_SREDO      0x190    /* Shift Redo key */
                    204: #define    KEY_SREPLACE   0x191    /* Shift Replace key */
                    205: #define    KEY_SRIGHT     0x192    /* Shift Right Arrow key */
                    206: #define    KEY_SRESUME    0x193    /* Shift Resume key */
                    207: #define    KEY_SSAVE      0x194    /* Shift Save key */
                    208: #define    KEY_SSUSPEND   0x195    /* Shift Suspend key */
                    209: #define    KEY_SUNDO      0x196    /* Shift Undo key */
                    210: #define    KEY_SUSPEND    0x197    /* Suspend key */
                    211: #define    KEY_UNDO       0x198    /* Undo key  */
                    212: #define    KEY_MAX        0x198    /* maximum extended key value */
                    213:
1.7       cgd       214: /* 8-bit ASCII characters. */
1.29      simonb    215: #define        unctrl(c)               __unctrl[((unsigned)c) & 0xff]
                    216: #define        unctrllen(ch)           __unctrllen[((unsigned)ch) & 0xff]
1.7       cgd       217:
1.22      mrg       218: extern char     *__unctrl[256];        /* Control strings. */
1.7       cgd       219: extern char     __unctrllen[256];      /* Control strings length. */
                    220:
                    221: /*
                    222:  * A window an array of __LINE structures pointed to by the 'lines' pointer.
                    223:  * A line is an array of __LDATA structures pointed to by the 'line' pointer.
                    224:  */
                    225:
1.31      jdc       226: /*
                    227:  * Definitions for characters and attributes in __LDATA
                    228:  */
                    229: #define __CHARTEXT     0x000000ff      /* bits for 8-bit characters */
                    230: #define __NORMAL       0x00000000      /* Added characters are normal. */
                    231: #define __STANDOUT     0x00010000      /* Added characters are standout. */
                    232: #define __UNDERSCORE   0x00020000      /* Added characters are underscored. */
                    233: #define __REVERSE      0x00040000      /* Added characters are reverse
                    234:                                           video. */
                    235: #define __BLINK                0x00080000      /* Added characters are blinking. */
                    236: #define __DIM          0x00100000      /* Added characters are dim. */
                    237: #define __BOLD         0x00200000      /* Added characters are bold. */
                    238: #define __BLANK                0x00400000      /* Added characters are blanked. */
                    239: #define __PROTECT      0x00800000      /* Added characters are protected. */
                    240: #define __ALTCHARSET   0x01000000      /* Added characters are ACS */
                    241: #define __COLOR                0xee000000      /* Color bits */
                    242: #define __ATTRIBUTES   0xefff0000      /* All 8-bit attribute bits */
                    243:
1.30      blymn     244: typedef struct __ldata __LDATA;
                    245: typedef struct __line  __LINE;
                    246: typedef struct __window  WINDOW;
                    247:
                    248: /*
                    249:  * Attribute definitions
                    250:  */
1.31      jdc       251: #define        A_NORMAL        __NORMAL
1.30      blymn     252: #define        A_STANDOUT      __STANDOUT
                    253: #define        A_UNDERLINE     __UNDERSCORE
                    254: #define        A_REVERSE       __REVERSE
                    255: #define        A_BLINK         __BLINK
                    256: #define        A_DIM           __DIM
                    257: #define        A_BOLD          __BOLD
                    258: #define        A_BLANK         __BLANK
                    259: #define        A_PROTECT       __PROTECT
1.31      jdc       260: #define        A_ALTCHARSET    __ALTCHARSET
                    261: #define        A_ATTRIBUTES    __ATTRIBUTES
                    262: #define        A_CHARTEXT      __CHARTEXT
                    263: #define        A_COLOR         __COLOR
1.30      blymn     264:
                    265: /*
                    266:  * Alternate character set definitions
                    267:  */
                    268:
1.31      jdc       269: #define        NUM_ACS 128
1.30      blymn     270:
                    271: extern chtype _acs_char[NUM_ACS];
                    272:
1.31      jdc       273: #define        ACS_RARROW      _acs_char['+']
                    274: #define        ACS_LARROW      _acs_char[',']
                    275: #define        ACS_UARROW      _acs_char['-']
                    276: #define        ACS_DARROW      _acs_char['.']
                    277: #define        ACS_BLOCK       _acs_char['0']
                    278: #define        ACS_DIAMOND     _acs_char['`']
                    279: #define        ACS_CKBOARD     _acs_char['a']
                    280: #define        ACS_DEGREE      _acs_char['f']
                    281: #define        ACS_PLMINUS     _acs_char['g']
                    282: #define        ACS_BOARD       _acs_char['h']
                    283: #define        ACS_LANTERN     _acs_char['i']
                    284: #define        ACS_LRCORNER    _acs_char['j']
                    285: #define        ACS_URCORNER    _acs_char['k']
                    286: #define        ACS_ULCORNER    _acs_char['l']
                    287: #define        ACS_LLCORNER    _acs_char['m']
                    288: #define        ACS_PLUS        _acs_char['n']
                    289: #define        ACS_HLINE       _acs_char['q']
                    290: #define        ACS_S1          _acs_char['o']
                    291: #define        ACS_S9          _acs_char['s']
                    292: #define        ACS_LTEE        _acs_char['t']
                    293: #define        ACS_RTEE        _acs_char['u']
                    294: #define        ACS_BTEE        _acs_char['v']
                    295: #define        ACS_TTEE        _acs_char['w']
                    296: #define        ACS_VLINE       _acs_char['x']
                    297: #define        ACS_BULLET      _acs_char['~']
1.30      blymn     298:
                    299: /* System V compatability */
1.31      jdc       300: #define        ACS_SBBS        ACS_LRCORNER
                    301: #define        ACS_BBSS        ACS_URCORNER
1.30      blymn     302: #define        ACS_BSSB        ACS_ULCORNER
1.31      jdc       303: #define        ACS_SSBB        ACS_LLCORNER
                    304: #define        ACS_SSSS        ACS_PLUS
                    305: #define        ACS_BSBS        ACS_HLINE
                    306: #define        ACS_SSSB        ACS_LTEE
                    307: #define        ACS_SBSS        ACS_RTEE
1.30      blymn     308: #define        ACS_SSBS        ACS_BTEE
                    309: #define        ACS_BSSS        ACS_TTEE
                    310: #define        ACS_SBSB        ACS_VLINE
1.31      jdc       311: #define        _acs_map        _acs_char
1.30      blymn     312:
                    313: /*
1.31      jdc       314:  * Colour definitions (ANSI colour numbers)
1.30      blymn     315:  */
                    316:
1.31      jdc       317: #define        COLOR_BLACK     0x00
                    318: #define        COLOR_RED       0x01
                    319: #define        COLOR_GREEN     0x02
                    320: #define        COLOR_YELLOW    0x03
                    321: #define        COLOR_BLUE      0x04
                    322: #define        COLOR_MAGENTA   0x05
                    323: #define        COLOR_CYAN      0x06
                    324: #define        COLOR_WHITE     0x07
1.7       cgd       325:
1.31      jdc       326: #define        COLOR_PAIR(n)   (((n) << 25) & A_COLOR)
                    327: #define        PAIR_NUMBER(n)  (((n) & A_COLOR) >> 25)
1.7       cgd       328:
1.4       mycroft   329: /* Curses external declarations. */
                    330: extern WINDOW  *curscr;                /* Current screen. */
                    331: extern WINDOW  *stdscr;                /* Standard screen. */
                    332:
1.7       cgd       333: extern struct termios __orig_termios;  /* Terminal state before curses */
                    334: extern struct termios __baset;         /* Our base terminal state */
1.22      mrg       335: extern int     __tcaction;             /* If terminal hardware set. */
1.4       mycroft   336:
                    337: extern int      COLS;                  /* Columns on the screen. */
                    338: extern int      LINES;                 /* Lines on the screen. */
1.31      jdc       339: extern int      COLORS;                /* Max colours on the screen. */
                    340: extern int      COLOR_PAIRS;           /* Max colour pairs on the screen. */
1.4       mycroft   341:
                    342: extern char    *ttytype;               /* Full name of current terminal. */
                    343:
                    344: #define        ERR     (0)                     /* Error return. */
                    345: #define        OK      (1)                     /* Success return. */
                    346:
1.33      blymn     347: /*
                    348:  * The following have, traditionally, been macros but X/Open say they
                    349:  * need to be functions.  Keep the old macros for debugging.
                    350:  */
                    351: #ifdef _CURSES_USE_MACROS
1.4       mycroft   352: /* Standard screen pseudo functions. */
1.7       cgd       353: #define        addbytes(s, n)                  __waddbytes(stdscr, s, n, 0)
                    354: #define        addch(ch)                       waddch(stdscr, ch)
                    355: #define        addnstr(s, n)                   waddnstr(stdscr, s, n)
1.26      simonb    356: #define        addstr(s)                       waddnstr(stdscr, s, -1)
1.31      jdc       357: #define bkgd(ch)                       wbkgd(stdscr, ch)
                    358: #define bkgdset(ch)                    wbkgdset(stdscr, ch)
1.30      blymn     359: #define        border(l, r, t, b, tl, tr, bl, br) \
                    360:        wborder(stdscr, l, r, t, b, tl, tr, bl, br)
1.7       cgd       361: #define        clear()                         wclear(stdscr)
                    362: #define        clrtobot()                      wclrtobot(stdscr)
                    363: #define        clrtoeol()                      wclrtoeol(stdscr)
                    364: #define        delch()                         wdelch(stdscr)
                    365: #define        deleteln()                      wdeleteln(stdscr)
                    366: #define        erase()                         werase(stdscr)
                    367: #define        getch()                         wgetch(stdscr)
                    368: #define        getstr(s)                       wgetstr(stdscr, s)
                    369: #define        inch()                          winch(stdscr)
                    370: #define        insch(ch)                       winsch(stdscr, ch)
1.30      blymn     371: #define        insdelln(n)                     winsdelln(stdscr, n)
1.7       cgd       372: #define        insertln()                      winsertln(stdscr)
                    373: #define        move(y, x)                      wmove(stdscr, y, x)
                    374: #define        refresh()                       wrefresh(stdscr)
1.31      jdc       375: #define        scrl(n)                         wscrl(stdscr, n)
1.7       cgd       376: #define        standend()                      wstandend(stdscr)
                    377: #define        standout()                      wstandout(stdscr)
1.22      mrg       378: #define        timeout(delay)                  wtimeout(stdscr, delay)
                    379: #define        underscore()                    wunderscore(stdscr)
                    380: #define        underend()                      wunderend(stdscr)
                    381: #define        attron(attr)                    wattron(stdscr, attr)
                    382: #define        attroff(attr)                   wattroff(stdscr, attr)
                    383: #define        attrset(attr)                   wattrset(stdscr, attr)
1.7       cgd       384: #define        waddbytes(w, s, n)              __waddbytes(w, s, n, 0)
1.26      simonb    385: #define        waddstr(w, s)                   waddnstr(w, s, -1)
1.4       mycroft   386:
                    387: /* Standard screen plus movement pseudo functions. */
1.7       cgd       388: #define        mvaddbytes(y, x, s, n)          mvwaddbytes(stdscr, y, x, s, n)
                    389: #define        mvaddch(y, x, ch)               mvwaddch(stdscr, y, x, ch)
                    390: #define        mvaddnstr(y, x, s, n)           mvwaddnstr(stdscr, y, x, s, n)
                    391: #define        mvaddstr(y, x, s)               mvwaddstr(stdscr, y, x, s)
                    392: #define        mvdelch(y, x)                   mvwdelch(stdscr, y, x)
                    393: #define        mvgetch(y, x)                   mvwgetch(stdscr, y, x)
                    394: #define        mvgetstr(y, x, s)               mvwgetstr(stdscr, y, x, s)
                    395: #define        mvinch(y, x)                    mvwinch(stdscr, y, x)
                    396: #define        mvinsch(y, x, c)                mvwinsch(stdscr, y, x, c)
                    397: #define        mvwaddbytes(w, y, x, s, n) \
                    398:        (wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
                    399: #define        mvwaddch(w, y, x, ch) \
                    400:        (wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
                    401: #define        mvwaddnstr(w, y, x, s, n) \
                    402:        (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
                    403: #define        mvwaddstr(w, y, x, s) \
1.25      simonb    404:        (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, -1))
1.7       cgd       405: #define        mvwdelch(w, y, x) \
                    406:        (wmove(w, y, x) == ERR ? ERR : wdelch(w))
                    407: #define        mvwgetch(w, y, x) \
                    408:        (wmove(w, y, x) == ERR ? ERR : wgetch(w))
                    409: #define        mvwgetstr(w, y, x, s) \
                    410:        (wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
                    411: #define        mvwinch(w, y, x) \
                    412:        (wmove(w, y, x) == ERR ? ERR : winch(w))
                    413: #define        mvwinsch(w, y, x, c) \
                    414:        (wmove(w, y, x) == ERR ? ERR : winsch(w, c))
                    415:
1.17      jtc       416: #define        getyx(w, y, x)          (y) = getcury(w), (x) = getcurx(w)
1.33      blymn     417: #define getbegyx(w, y, x)      (y) = getbegy(w), (x) = getbegx(w)
                    418: #define getmaxyx(w, y, x)      (y) = getmaxy(w), (x) = getmaxx(w)
                    419:
                    420: #else
                    421: /* Use functions not macros... */
                    422: int addbytes(const char *bytes, int count);
                    423: int addch(chtype ch);
                    424: int addnstr(const char *str, int n);
                    425: int addstr(const char *str);
1.36      jdc       426: int bkgd(chtype ch);
                    427: void bkgdset(chtype ch);
1.33      blymn     428: int border(chtype left, chtype right, chtype top, chtype bottom,
                    429:           chtype topleft, chtype topright, chtype botleft, chtype botright);
                    430: int clear(void);
                    431: int clrtobot(void);
                    432: int clrtoeol(void);
                    433: int delch(void);
                    434: int deleteln(void);
                    435: int erase(void);
                    436: int getch(void);
                    437: int getstr(char *str);
                    438: chtype inch(void);
                    439: int insch(chtype ch);
                    440: int insdelln(int lines);
                    441: int insertln(void);
                    442: int move(int y, int x);
                    443: int refresh(void);
                    444: int scrl(int lines);
                    445: int standend(void);
                    446: int standout(void);
                    447: void timeout(int delay);
                    448: int underscore(void);
1.35      thorpej   449: int underend(void);
1.33      blymn     450: int attron(int attr);
                    451: int attroff(int attr);
                    452: int attrset(int attr);
                    453: int waddbytes(WINDOW *win, const char *bytes, int count);
1.34      jdc       454: int waddstr(WINDOW *win, const char *s);
1.33      blymn     455:
                    456: /* Standard screen plus movement functions. */
                    457: int mvaddbytes(int y, int x, const char *bytes, int count);
                    458: int mvaddch(int y, int x, chtype ch);
                    459: int mvaddnstr(int y, int x, const char *str, int count);
                    460: int mvaddstr(int y, int x, const char *str);
                    461: int mvdelch(int y, int x);
                    462: int mvgetch(int y, int x);
                    463: int mvgetstr(int y, int x, char *str);
                    464: chtype mvinch(int y, int x);
                    465: int mvinsch(int y, int x, chtype ch);
                    466:
                    467:
                    468: int mvwaddbytes(WINDOW *win, int y, int x, const char *bytes, int count);
                    469: int mvwaddch(WINDOW *win, int y, int x, chtype ch);
                    470: int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int count);
                    471: int mvwaddstr(WINDOW *win, int y, int x, const char *str);
                    472: int mvwdelch(WINDOW *win, int y, int x);
                    473: int mvwgetch(WINDOW *win, int y, int x);
                    474: int mvwgetstr(WINDOW *win, int y, int x, char *str);
                    475: chtype mvwinch(WINDOW *win, int y, int x);
                    476: int mvwinsch(WINDOW *win, int y, int x, chtype ch);
                    477:
                    478: #endif /* _CURSES_USE_MACROS */
                    479:
1.34      jdc       480: #define        getyx(w, y, x)          (y) = getcury(w), (x) = getcurx(w)
1.31      jdc       481: #define        getbegyx(w, y, x)       (y) = getbegy(w), (x) = getbegx(w)
                    482: #define        getmaxyx(w, y, x)       (y) = getmaxy(w), (x) = getmaxx(w)
1.4       mycroft   483:
                    484: /* Public function prototypes. */
1.14      jtc       485: __BEGIN_DECLS
1.33      blymn     486: int     beep(void);
                    487: int     box(WINDOW *win, chtype vert, chtype horiz);
1.40    ! blymn     488: bool    can_change_colors(void);
1.33      blymn     489: int     cbreak(void);
                    490: int     clearok(WINDOW *win, bool flag);
                    491: int     color_content(short colour, short *redp, short *greenp, short *bluep);
1.38      blymn     492: int      copywin(const WINDOW *srcwin, WINDOW *dstwin, int sminrow,
                    493:                 int smincol, int dminrow, int dmincol, int dmaxrow,
                    494:                 int dmaxcol, int overlay);
1.40    ! blymn     495: int      curs_set(int visibility);
1.33      blymn     496: int     def_prog_mode(void);
                    497: int     def_shell_mode(void);
                    498: int     delwin(WINDOW *win);
1.38      blymn     499: WINDOW  *derwin(WINDOW *orig, int nlines, int ncols, int by, int bx);
1.39      blymn     500: WINDOW  *dupwin(WINDOW *win);
1.33      blymn     501: int     echo(void);
                    502: int     endwin(void);
                    503: int     flash(void);
                    504: int     flushinp(void);
                    505: int     flushok(WINDOW *win, bool bf);
                    506: char   *fullname(const char *bp, char *def);
                    507: chtype  getbkgd(WINDOW *win);
                    508: char   *getcap(char *name);
                    509: int     getcury(WINDOW *win);
                    510: int     getcurx(WINDOW *win);
                    511: int     getbegy(WINDOW *win);
                    512: int     getbegx(WINDOW *win);
                    513: int     getmaxy(WINDOW *win);
                    514: int     getmaxx(WINDOW *win);
                    515: int     gettmode(void);
                    516: bool    has_colors(void);
                    517: int     idlok(WINDOW *win, bool bf);
                    518: int     init_color(short colour, short red, short green, short blue);
                    519: int     init_pair(short pair, short fore, short back);
                    520: WINDOW *initscr(void);
                    521: int     intrflush(WINDOW *win, bool bf);
                    522: bool    isendwin(void);
                    523: void    keypad(WINDOW *win, bool bf);
                    524: int     leaveok(WINDOW *win, bool bf);
                    525: char   *longname(void);
1.40    ! blymn     526: int      meta(WINDOW *win, bool bf);
1.33      blymn     527: int     mvcur(int ly, int lx, int y, int x);
                    528: int     mvprintw(int y, int x, const char *fmt, ...);
                    529: int     mvscanw(int y, int x, const char *fmt, ...);
                    530: int     mvwin(WINDOW *win, int y, int x);
                    531: int     mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
                    532: int     mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...);
1.37      blymn     533: WINDOW *newwin(int nlines, int ncols, int by, int bx);
1.33      blymn     534: int     nl(void);
                    535: int     nocbreak(void);
                    536: void    nodelay(WINDOW *win, bool bf);
                    537: int     noecho(void);
                    538: int     nonl(void);
                    539: int     noraw(void);
                    540: int     notimeout(WINDOW *win, bool bf);
                    541: int     overlay(const WINDOW *win1, WINDOW *win2);
                    542: int     overwrite(const WINDOW *win1, WINDOW *win2);
                    543: int     pair_content(short pair, short *forep, short *backp);
                    544: int     printw(const char *, ...);
                    545: int     raw(void);
                    546: int     reset_prog_mode(void);
                    547: int     reset_shell_mode(void);
                    548: int     resetty(void);
                    549: int     savetty(void);
                    550: int     scanw(const char *, ...);
                    551: int     scroll(WINDOW *win);
                    552: int     scrollok(WINDOW *win, bool bf);
                    553: int     setterm(char *);
1.37      blymn     554: int      start_color(void);
                    555: WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int by, int bx);
1.33      blymn     556: int     touchline(WINDOW *win, int start, int count);
                    557: int     touchoverlap(WINDOW *win1, WINDOW *win2);
                    558: int     touchwin(WINDOW *win);
                    559: int     vwprintw(WINDOW *win, const char *fmt, _BSD_VA_LIST_);
                    560: int     vwscanw(WINDOW *win, const char *fmt, _BSD_VA_LIST_);
                    561: int     waddch(WINDOW *win, chtype ch);
                    562: int     waddnstr(WINDOW *win, const char *s, int n);
                    563: int     wattron(WINDOW *win, int attr);
                    564: int     wattroff(WINDOW *win, int attr);
                    565: int     wattrset(WINDOW *win, int attr);
                    566: int     wbkgd(WINDOW *win, chtype ch);
                    567: void    wbkgdset(WINDOW *win, chtype ch);
                    568: int     wborder(WINDOW *win, chtype left, chtype right, chtype top,
                    569:                 chtype bottom, chtype topleft, chtype topright,
                    570:                 chtype botleft, chtype botright);
                    571: int     wclear(WINDOW *win);
                    572: int     wclrtobot(WINDOW *win);
                    573: int     wclrtoeol(WINDOW *win);
                    574: int     wdelch(WINDOW *win);
                    575: int     wdeleteln(WINDOW *win);
                    576: int     werase(WINDOW *win);
                    577: int     wgetch(WINDOW *win);
                    578: int     wgetstr(WINDOW *win, char *str);
                    579: chtype  winch(WINDOW *win);
                    580: int     winsch(WINDOW *win, chtype ch);
                    581: int     winsdelln(WINDOW *win, int lines);
                    582: int     winsertln(WINDOW *win);
                    583: int     wmove(WINDOW *win, int y, int x);
                    584: int     wprintw(WINDOW *win, const char *fmt, ...);
                    585: int     wrefresh(WINDOW *win);
                    586: int     wscanw(WINDOW *win, const char *fmt, ...);
                    587: int     wscrl(WINDOW *win, int lines);
                    588: int     wstandend(WINDOW *win);
                    589: int     wstandout(WINDOW *win);
                    590: void    wtimeout(WINDOW *win, int delay);
                    591: int     wunderend(WINDOW *win);
                    592: int     wunderscore(WINDOW *win);
1.4       mycroft   593:
1.7       cgd       594: /* Private functions that are needed for user programs prototypes. */
1.33      blymn     595: int     __cputchar(int);
                    596: int     __waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr);
1.14      jtc       597: __END_DECLS
1.1       cgd       598:
1.4       mycroft   599: #endif /* !_CURSES_H_ */

CVSweb <webmaster@jp.NetBSD.org>