📄 curses.form
字号:
/* @(#)curses.form 1.1 92/07/30 SMI; from S5R3 1.4.1.4 *//* * curses.h - this file is automatically made from caps, curses.form and * curses.ed. * Don't make changes directly to curses.h! */#ifndef _SUBWIN/* The definition for 'reg' is not standard, and is provided for compatibility reasons. Users are discouraged from using this.*/# define reg register# ifndef NONSTANDARD#ifndef stdin# include <stdio.h>#endif /* stdin */ /* * This trick is used to distinguish between SYSV and V7 systems. * We assume that L_ctermid is only defined in stdio.h in SYSV * systems, but not in V7 or Berkeley UNIX. */# ifdef L_ctermid# define SYSV# endif# include <unctrl.h># ifdef SYSV#ifndef VINTR# include <termio.h>#endif /* VINTR */ typedef struct termio SGTTY;#endif /* SYSV */# ifndef SYSV#ifndef _SGTTYB_# include <sgtty.h>#endif /* _SGTTYB_ */ typedef struct sgttyb SGTTY;/* * Here we attempt to improve portability by providing some #defines * for SYSV functions on non-SYSV systems. */# define memcpy(dst, src, len) bcopy((src), (dst), (len))# define strchr index# define strrchr rindex# endif# else /* NONSTANDARD *//* * NONSTANDARD is intended for a standalone program (no UNIX) * that manages screens. The specific program is Alan Hewett's * ITC, which runs standalone on an 11/23 (at least for now). * It is unclear whether this code needs to be supported anymore. * It hasn't been tested in quite awhile. */# define NULL 0# endif /* NONSTANDARD */typedef char bool;/* * chtype is the type used to store a character together with attributes. * It can be set to "char" to save space, or "long" to get more attributes. */# ifdef CHTYPE typedef CHTYPE chtype;# else typedef unsigned short chtype;# endif /* CHTYPE *//* TRUE and FALSE get defined so many times, *//* let's not get in the way of other definitions. */#if !defined(TRUE) || ((TRUE) != 1)# define TRUE (1)#endif#if !defined(FALSE) || ((FALSE) != 0)# define FALSE (0)#endif#if !defined(ERR) || ((ERR) != -1)# define ERR (-1)#endif#if !defined(OK) || ((OK) != 0)# define OK (0)#endif/* values for win->_flags */# define _SUBWIN 01# define _ENDLINE 02# define _FULLWIN 04# define _SCROLLWIN 010# define _FLUSH 020# define _ISPAD 040# define _WINCHANGED 0100# define _WINMOVED 0200/* _firstch is initially set to this */# define _NOCHANGE -1struct _win_st { short _cury, _curx; short _maxy, _maxx; short _begy, _begx; short _flags; chtype _attrs; bool _clear; bool _leave; bool _scroll; bool _use_idl; /* 0=no, 1=yes, 2=go by need_idl */ bool _use_keypad; /* 0=no, 1=yes, 2=yes/timeout */ bool _use_meta; /* T=use the meta key */ bool _nodelay; /* T=don't wait for tty input */ chtype **_y; short *_firstch; short *_lastch; short _tmarg,_bmarg; /* end of Vr2 structure */ bool _need_idl; /* T=have done ins/del line/scroll recently */ bool _notimeout; /* T=do wait for rest of function key */ short _pminrow, _pmincol, _sminrow, _smincol, _smaxrow, _smaxcol; short _yoffset;};extern int LINES, COLS;typedef struct _win_st WINDOW;extern WINDOW *stdscr, *curscr;extern char *Def_term, ttytype[];#ifdef lint/* * Various tricks to shut up lint about things that are perfectly fine. */# ifndef CURSES /* if not internal to curses source */struct screen { int _nobody_;};# endif /* CURSES */#endif /* lint */typedef struct screen SCREEN;# ifndef NOMACROS# ifndef MINICURSES/* * psuedo functions for standard screen */# define addch(ch) waddch(stdscr, ch)# define getch() wgetch(stdscr)# define addstr(str) waddstr(stdscr, str)# define getstr(str) wgetstr(stdscr, str)# define move(y, x) wmove(stdscr, y, x)# define clear() wclear(stdscr)# define erase() werase(stdscr)# define clrtobot() wclrtobot(stdscr)# define clrtoeol() wclrtoeol(stdscr)# define insertln() winsertln(stdscr)# define deleteln() wdeleteln(stdscr)# define refresh() wrefresh(stdscr)# define inch() winch(stdscr)# define insch(c) winsch(stdscr,c)# define delch() wdelch(stdscr)# define standout() wstandout(stdscr)# define standend() wstandend(stdscr)# define attron(at) wattron(stdscr,at)# define attroff(at) wattroff(stdscr,at)# define attrset(at) wattrset(stdscr,at)# define echochar(ch) wechochar(stdscr, ch)# define setscrreg(t,b) wsetscrreg(stdscr, t, b)# define wsetscrreg(win,t,b) (win->_tmarg=(t),win->_bmarg=(b))/* * mv functions */#define mvwaddch(win,y,x,ch) (wmove(win,y,x)==ERR?ERR:waddch(win,ch))#define mvwgetch(win,y,x) (wmove(win,y,x)==ERR?ERR:wgetch(win))#define mvwaddstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:waddstr(win,str))#define mvwgetstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:wgetstr(win,str))#define mvwinch(win,y,x) (wmove(win,y,x)==ERR?ERR:winch(win))#define mvwdelch(win,y,x) (wmove(win,y,x)==ERR?ERR:wdelch(win))#define mvwinsch(win,y,x,c) (wmove(win,y,x)==ERR?ERR:winsch(win,c))#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)#define mvgetch(y,x) mvwgetch(stdscr,y,x)#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)#define mvinch(y,x) mvwinch(stdscr,y,x)#define mvdelch(y,x) mvwdelch(stdscr,y,x)#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)# else /* MINICURSES *//* * MINICURSES is not documented or supported anymore. The intent was * to avoid the window handling stuff for a smaller curses. However, * the bulk of the code is below refresh (3/4 or so) so the savings * are insignificant. This version of curses just isn't well suited * to a 16 bit processor, except with a tiny application. */# define addch(ch) m_addch(ch)# define addstr(str) m_addstr(str)# define move(y, x) m_move(y, x)# define clear() m_clear()# define erase() m_erase()# define refresh() m_refresh()# define standout() wstandout(stdscr)# define standend() wstandend(stdscr)# define attron(at) wattron(stdscr,at)# define attroff(at) wattroff(stdscr,at)# define attrset(at) wattrset(stdscr,at)# define mvaddch(y,x,ch) move(y, x), addch(ch)# define mvaddstr(y,x,str) move(y, x), addstr(str)# define initscr m_initscr# define newterm m_newterm# define echochar(ch) (m_addch(ch) == ERR ? ERR : m_refresh())/* * These functions don't exist in minicurses, so we define them * to nonexistent functions to help the user catch the error. */#define getch m_getch#define getstr m_getstr#define clrtobot m_clrtobot#define clrtoeol m_clrtoeol#define insertln m_insertln#define deleteln m_deleteln#define inch m_inch#define insch m_insch#define delch m_delch/* mv functions that aren't valid */#define mvwaddch m_mvwaddch#define mvwgetch m_mvwgetch#define mvwaddstr m_mvaddstr#define mvwgetstr m_mvwgetstr#define mvwinch m_mvwinch#define mvwdelch m_mvwdelch#define mvwinsch m_mvwinsch#define mvgetch m_mvwgetch#define mvgetstr m_mvwgetstr#define mvinch m_mvwinch#define mvdelch m_mvwdelch#define mvinsch m_mvwinsch/* Real functions that aren't valid */#define box m_box#define delwin m_delwin#define longname m_longname#define makenew m_makenew#define mvprintw m_mvprintw#define mvscanw m_mvscanw#define mvwin m_mvwin#define mvwprintw m_mvwprintw#define mvwscanw m_mvwscanw#define newwin m_newwin#define _outchar m_outchar#define overlay m_overlay#define overwrite m_overwrite#define printw m_printw#define putp m_putp#define scanw m_scanw#define scroll m_scroll#define subwin m_subwin#define touchwin m_touchwin#define _tscroll m_tscroll#define _tstp m_tstp#define vidattr m_vidattr#define waddch m_waddch#define waddstr m_waddstr#define wclear m_wclear#define wclrtobot m_wclrtobot#define wclrtoeol m_wclrtoeol#define wdelch m_wdelch#define wdeleteln m_wdeleteln#define werase m_werase#define wgetch m_wgetch#define wgetstr m_wgetstr#define winsch m_winsch#define winsertln m_winsertln#define wmove m_wmove#define wprintw m_wprintw#define wrefresh m_wrefresh#define wscanw m_wscanw#define setscrreg m_setscrreg#define wsetscrreg m_wsetscrreg# endif /* MINICURSES *//* * psuedo functions */#define getyx(win,y,x) y = win->_cury, x = win->_curx#define getbegyx(win,y,x) y = win->_begy, x = win->_begx#define getmaxyx(win,y,x) y = win->_maxy, x = win->_maxx#define getsyx(y,x) _getsyx(&y,&x)#define winch(win) (win->_y[win->_cury][win->_curx])WINDOW *initscr(), *newwin(), *subwin(), *newpad(), *subpad();char *longname(), *keyname();char erasechar(), killchar();int wgetch(); /* because it can return KEY_*, for instance. */SCREEN *newterm(), *set_term();char *slk_label();/* Various video attributes */#define A_STANDOUT 0000200#define _STANDOUT A_STANDOUT /* for compatability with old curses */#define A_UNDERLINE 0000400#define A_REVERSE 0001000#define A_BLINK 0002000#define A_DIM 0004000#define A_BOLD 0010000#define A_ALTCHARSET 0100000/* The next two are subject to change so don't depend on them */#define A_INVIS 0020000#define A_PROTECT 0040000#define A_NORMAL 0000000#define A_ATTRIBUTES 0177600#define A_CHARTEXT 0000177/* * Standard alternate character set. The current ACS world is evolving, * so we support only a widely available subset: the line drawing characters * from the VT100, plus a few from the Teletype 5410. Eventually there * may be support of more sophisticated ACS line drawing, such as that * in the Teletype 5410, the HP line drawing set, and the like. There may * be support for some non line oriented characters as well. * * Line drawing ACS names are of the form ACS_trbl, where t is the top, r * is the right, b is the bottom, and l is the left. t, r, b, and l might * be B (blank), S (single), D (double), or T (thick). The subset defined * here only uses B and S. */#define ACS_BSSB (acs_map['l'])#define ACS_SSBB (acs_map['m'])#define ACS_BBSS (acs_map['k'])#define ACS_SBBS (acs_map['j'])#define ACS_SBSS (acs_map['u'])#define ACS_SSSB (acs_map['t'])#define ACS_SSBS (acs_map['v'])#define ACS_BSSS (acs_map['w'])#define ACS_BSBS (acs_map['q'])#define ACS_SBSB (acs_map['x'])#define ACS_SSSS (acs_map['n'])/* * Human readable names for the most commonly used characters. * "Upper", "right", etc. are chosen to be consistent with the vt100 manual. */#define ACS_ULCORNER ACS_BSSB#define ACS_LLCORNER ACS_SSBB#define ACS_URCORNER ACS_BBSS#define ACS_LRCORNER ACS_SBBS#define ACS_RTEE ACS_SBSS#define ACS_LTEE ACS_SSSB#define ACS_BTEE ACS_SSBS#define ACS_TTEE ACS_BSSS#define ACS_HLINE ACS_BSBS#define ACS_VLINE ACS_SBSB#define ACS_PLUS ACS_SSSS#define ACS_S1 (acs_map['o']) /* scan line 1 */#define ACS_S9 (acs_map['s']) /* scan line 9 */#define ACS_DIAMOND (acs_map['`']) /* diamond */#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */#define ACS_DEGREE (acs_map['f']) /* degree symbol */#define ACS_PLMINUS (acs_map['g']) /* plus/minus */#define ACS_BULLET (acs_map['~']) /* bullet */ /* Teletype 5410/5420 symbols */#define ACS_LARROW (acs_map[',']) /* arrow pointing left */#define ACS_RARROW (acs_map['+']) /* arrow pointing right */#define ACS_DARROW (acs_map['.']) /* arrow pointing down */#define ACS_UARROW (acs_map['-']) /* arrow pointing up */#define ACS_BOARD (acs_map['h']) /* board of squares */#define ACS_LANTERN (acs_map['i']) /* lantern symbol */#define ACS_BLOCK (acs_map['0']) /* solid square block */extern chtype *acs_map;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -