📄 curses.h
字号:
extern int slk_attr_off(attr_t); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int slk_attron(chtype); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int slk_attr_on(attr_t); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int slk_attrset(chtype); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int slk_attr_set(attr_t); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int slk_clear(void); /* implemented */extern int slk_init(int); /* implemented */extern char *slk_label(int); /* implemented */extern int slk_noutrefresh(void); /* implemented */extern int slk_refresh(void); /* implemented */extern int slk_restore(void); /* implemented */extern int slk_set(int,const char *,int); /* implemented */extern int slk_touch(void); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int slk_wset(int, wchar_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int standout(void); /* generated */extern int standend(void); /* generated */extern int start_color(void); /* implemented */extern WINDOW *subpad(WINDOW *, int, int, int, int); /* implemented */extern WINDOW *subwin(WINDOW *,int,int,int,int); /* implemented */extern int syncok(WINDOW *win, bool); /* implemented */extern attr_t termattrs(void); /* implemented */extern char *termname(void); /* implemented */extern int tigetflag(const char *); /* implemented */extern int tigetnum(const char *); /* implemented */extern char *tigetstr(const char *); /* implemented */extern int timeout(int); /* implemented */extern int typeahead(int); /* implemented */extern int ungetch(int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int unget_wch(const wchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int untouchwin(WINDOW *); /* generated */extern void use_env(bool); /* implemented */extern int vidattr(chtype); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int vid_attr(attr_t); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int vidputs(chtype, int (*)(int)); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int vid_puts(attr_t, int (*)(int)); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int vline(chtype, int); /* generated */#ifdef _XOPEN_SOURCE_EXTENDEDextern int vline_set(const cchar_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int vwprintw(WINDOW *,const char *,va_list); /* implemented */extern int vw_printw(WINDOW *,const char *,va_list); /* implemented */extern int vwscanw(WINDOW *,const char *,va_list); /* implemented */extern int vw_scanw(WINDOW *,const char *,va_list); /* implemented */extern int waddch(WINDOW *, const chtype); /* implemented */extern int waddchnstr(WINDOW *,const chtype *const,int); /* implemented */extern int waddchstr(WINDOW *,const chtype *); /* generated */extern int waddnstr(WINDOW *,const char *const,int); /* implemented */extern int waddstr(WINDOW *,const char *); /* generated */#ifdef _XOPEN_SOURCE_EXTENDEDextern int waddwstr(WINDOW *,const wchar_t *); /* missing */extern int wadd_wch(WINDOW *,const cchar_t *); /* missing */extern int wadd_wchnstr(WINDOW *,const cchar_t *,int); /* missing */extern int wadd_wchstr(WINDOW *,const cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wattron(WINDOW *, int); /* generated */extern int wattroff(WINDOW *, int); /* generated */extern int wattrset(WINDOW *, int); /* generated */extern attr_t wattr_get(WINDOW *); /* generated */extern int wattr_on(WINDOW *, const attr_t); /* implemented */extern int wattr_off(WINDOW *, const attr_t); /* implemented */extern int wattr_set(WINDOW *, attr_t); /* implemented */extern int wbkgd(WINDOW *,const chtype); /* implemented */extern void wbkgdset(WINDOW *,chtype); /* generated */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wbkgrndset(WINDOW *,const cchar_t *); /* missing */extern int wbkgrnd(WINDOW *,const cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wborder(WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wborder_set(WINDOW *,cchar_t,cchar_t,cchar_t,cchar_t,cchar_t,cchar_t,cchar_t,cchar_t); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wchgat(WINDOW *, int, attr_t, short, const void *);/* implemented */extern int wclear(WINDOW *); /* implemented */extern int wclrtobot(WINDOW *); /* implemented */extern int wclrtoeol(WINDOW *); /* implemented */extern void wcursyncup(WINDOW *); /* implemented */extern int wdelch(WINDOW *); /* implemented */extern int wdeleteln(WINDOW *); /* generated */extern int wechochar(WINDOW *, const chtype); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wecho_wchar(WINDOW *, const cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int werase(WINDOW *); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wgetbkgrnd(WINDOW *, cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wgetch(WINDOW *); /* implemented */extern int wgetnstr(WINDOW *,char *,int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wgetn_wstr(WINDOW *,wint_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wgetstr(WINDOW *, char *); /* generated */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wget_wch(WINDOW *, wint_t *); /* missing */extern int wget_wstr(WINDOW *, wint_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int whline(WINDOW *, chtype, int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int whline_set(WINDOW *, const cchar_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern chtype winch(WINDOW *); /* generated */extern int winchnstr(WINDOW *, chtype *, int); /* implemented */extern int winchstr(WINDOW *, chtype *); /* generated */extern int winnstr(WINDOW *, char *, int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int winnwstr(WINDOW *, wchar_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int winsch(WINDOW *, chtype); /* implemented */extern int winsdelln(WINDOW *,int); /* implemented */extern int winsertln(WINDOW *); /* generated */extern int winsnstr(WINDOW *, const char *,int); /* implemented */extern int winsstr(WINDOW *, const char *); /* generated */extern int winstr(WINDOW *, char *); /* generated */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wins_nwstr(WINDOW *, const wchar_t *, int); /* missing */extern int wins_wch(WINDOW *, const cchar_t *); /* missing */extern int wins_wstr(WINDOW *, const wchar_t *); /* missing */extern int winwstr(WINDOW *, wchar_t *); /* missing */extern int win_wch(WINDOW *, const cchar_t *); /* missing */extern int win_wchnstr(WINDOW *, const cchar_t *, int); /* missing */extern int win_wchstr(WINDOW *, const cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wmove(WINDOW *,int,int); /* implemented */extern int wnoutrefresh(WINDOW *); /* implemented */extern int wprintw(WINDOW *,const char *,...); /* implemented */extern int wredrawln(WINDOW *,int,int); /* implemented */extern int wrefresh(WINDOW *); /* implemented */extern int wresize(WINDOW *, int, int); /* implemented */extern int wscanw(WINDOW *,const char *,...); /* implemented */extern int wscrl(WINDOW *,int); /* implemented */extern int wsetscrreg(WINDOW *,int,int); /* implemented */extern int wstandout(WINDOW *); /* generated */extern int wstandend(WINDOW *); /* generated */extern void wsyncdown(WINDOW *); /* implemented */extern void wsyncup(WINDOW *); /* implemented */extern int wtimeout(WINDOW *,int); /* implemented */extern int wtouchln(WINDOW *,int,int,int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern wchar_t wunctrl(cchar_t *); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */extern int wvline(WINDOW *,chtype,int); /* implemented */#ifdef _XOPEN_SOURCE_EXTENDEDextern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */#endif /* _XOPEN_SOURCE_EXTENDED */#ifdef __cplusplus}#endif/* attributes */#define A_ATTRIBUTES 0xffffff00#define A_NORMAL 0x00000000#define A_STANDOUT 0x00010000#define A_UNDERLINE 0x00020000#define A_REVERSE 0x00040000#define A_BLINK 0x00080000#define A_DIM 0x00100000#define A_BOLD 0x00200000#define A_ALTCHARSET 0x00400000#define A_INVIS 0x00800000#define A_PROTECT 0x01000000#define A_HORIZONTAL 0x02000000 /* XSI Curses attr -- not yet used */#define A_LEFT 0x04000000 /* XSI Curses attr -- not yet used */#define A_LOW 0x08000000 /* XSI Curses attr -- not yet used */#define A_RIGHT 0x10000000 /* XSI Curses attr -- not yet used */#define A_TOP 0x20000000 /* XSI Curses attr -- not yet used */#define A_VERTICAL 0x40000000 /* XSI Curses attr -- not yet used */#define A_CHARTEXT 0x000000ff#define A_COLOR 0x0000ff00#define COLOR_PAIR(n) (n << 8) #define PAIR_NUMBER(a) ((a & A_COLOR) >> 8)/* * pseudo functions */#define wgetstr(w, s) wgetnstr(w, s, -1)#define getnstr(s, n) wgetnstr(stdscr, s, n)#define setterm(term) setupterm(term, 1, (int *)0)#define fixterm() reset_prog_mode()#define resetterm() reset_shell_mode()#define saveterm() def_prog_mode()#define crmode() cbreak()#define nocrmode() nocbreak()#define gettmode() #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 + 1, x = (win)->_maxx + 1)#define getparyx(win,y,x) (y = (win)->_pary, x = (win)->_parx)#define getsyx(y,x) getyx(stdscr, y, x)#define setsyx(y,x) (stdscr->_cury = y, stdscr->_curx = x)#define wbkgdset(win,ch) ((win)->_bkgd = (ch))/* It seems older SYSV curses versions define these */#define getattrs(win) ((win)->_attrs)#define getmaxx(win) ((win)->_maxx + 1)#define getmaxy(win) ((win)->_maxy + 1)#define winch(win) ((win)->_line[(win)->_cury].text[(win)->_curx])#define wstandout(win) (wattr_set(win,A_STANDOUT))#define wstandend(win) (wattr_set(win,A_NORMAL))#define wattr_set(win,at) ((win)->_attrs = (at))#define wattron(win,at) wattr_on(win, at)#define wattroff(win,at) wattr_off(win, at)#define wattrset(win,at) wattr_set(win, at)#define scroll(win) wscrl(win,1)#define touchwin(win) wtouchln((win), 0, (win)->_maxy + 1, 1)#define touchline(win, s, c) wtouchln((win), s, c, 1)#define untouchwin(win) wtouchln((win), 0, (win)->_maxy + 1, 0)#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0)#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)#define hline(ch, n) whline(stdscr, ch, n)#define vline(ch, n) wvline(stdscr, ch, n)#define winstr(w, s) winnstr(w, s, -1)#define winchstr(w, s) winchnstr(w, s, -1)#define winsstr(w, s) winsnstr(w, s, -1)#define redrawwin(w) wredrawln(w, 0, w->_maxy+1)#define waddstr(win,str) waddnstr(win,str,-1)#define waddchstr(win,str) waddchnstr(win,str,-1)/* * pseudo functions for standard screen */#define bkgdset(ch) wbkgdset(stdscr,ch)#define bkgd(ch) wbkgd(stdscr,ch)#define inch() winch(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 addch(ch) waddch(stdscr,ch)#define echochar(c) wechochar(stdscr, c)#define getch() wgetch(stdscr)#define addstr(str) waddnstr(stdscr,str,-1)#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() winsdelln(stdscr, 1)#define winsertln(w) winsdelln(w, 1)#define deleteln() winsdelln(stdscr, -1)#define wdeleteln(w) winsdelln(w, -1)#define refresh() wrefresh(stdscr)#define insch(c) winsch(stdscr,c)#define delch() wdelch(stdscr)#define setscrreg(t,b) wsetscrreg(stdscr,t,b)#define scrl(n) wscrl(stdscr,n)#define timeout(delay) wtimeout(stdscr, delay)#define addnstr(str,n) waddnstr(stdscr,str,n)#define addchstr(str) waddchstr(stdscr,str)#define addchnstr(str,n) waddchnstr(stdscr,str, n)#define insdelln(n) winsdelln(stdscr, n)#define insstr(s) winsstr(stdscr, s)#define insnstr(s,n) winsnstr(stdscr, s, n)#define instr(s) winstr(stdscr, s)#define innstr(s,n) winnstr(stdscr, s, n)#define inchstr(s) winchstr(stdscr, s)#define inchnstr(s,n) winchnstr(stdscr, s, n)/* * 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 mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n))#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1))#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n))#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1))#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str))#define mvgetnstr(y,x,str,n) (move(y,x) == ERR ? ERR : wgetnstr(stdscr,str,n))#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n))#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))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -