📄 curses.h.in
字号:
#define ACS_SSBB ACS_LLCORNER#define ACS_BBSS ACS_URCORNER#define ACS_SBBS ACS_LRCORNER#define ACS_SBSS ACS_RTEE#define ACS_SSSB ACS_LTEE#define ACS_SSBS ACS_BTEE#define ACS_BSSS ACS_TTEE#define ACS_BSBS ACS_HLINE#define ACS_SBSB ACS_VLINE#define ACS_SSSS ACS_PLUS#undef ERR#define ERR (-1)#undef OK#define OK (0)/* values for the _flags member */#define _SUBWIN 0x01 /* is this a sub-window? */#define _ENDLINE 0x02 /* is the window flush right? */#define _FULLWIN 0x04 /* is the window full-screen? */#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */#define _ISPAD 0x10 /* is this window a pad? */#define _HASMOVED 0x20 /* has cursor moved since last refresh? */#define _WRAPPED 0x40 /* cursor was just wrappped *//* * this value is used in the firstchar and lastchar fields to mark * unchanged lines */#define _NOCHANGE -1/* * this value is used in the oldindex field to mark lines created by insertions * and scrolls. */#define _NEWINDEX -1typedef struct screen SCREEN;typedef struct _win_st WINDOW;typedef chtype attr_t; /* ...must be at least as wide as chtype */#ifdef _XOPEN_SOURCE_EXTENDED#if @NCURSES_LIBUTF8@#ifdef mblen /* libutf8.h defines it w/o undefining first */#undef mblen#endif#include <libutf8.h>#endif#if @NEED_WCHAR_H@#include <wchar.h> /* ...to get mbstate_t, etc. */#endif#if @NCURSES_WCHAR_T@typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@;#endif#if @NCURSES_WINT_T@typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@;#endif#define CCHARW_MAX 5typedef struct{ attr_t attr; wchar_t chars[CCHARW_MAX];#if @NCURSES_EXT_COLORS@ int ext_color; /* color pair, must be more than 16-bits */#endif}cchar_t;#endif /* _XOPEN_SOURCE_EXTENDED */struct ldat;struct _win_st{ NCURSES_SIZE_T _cury, _curx; /* current cursor position */ /* window location and size */ NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */ NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */ short _flags; /* window state flags */ /* attribute tracking */ attr_t _attrs; /* current attribute for non-space character */ chtype _bkgd; /* current background char/attribute pair */ /* option values set by user */ bool _notimeout; /* no time out on function-key entry? */ bool _clear; /* consider all data in the window invalid? */ bool _leaveok; /* OK to not reset cursor on exit? */ bool _scroll; /* OK to scroll this window? */ bool _idlok; /* OK to use insert/delete line? */ bool _idcok; /* OK to use insert/delete char? */ bool _immed; /* window in immed mode? (not yet used) */ bool _sync; /* window in sync mode? */ bool _use_keypad; /* process function keys into KEY_ symbols? */ int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ struct ldat *_line; /* the actual line data */ /* global screen state */ NCURSES_SIZE_T _regtop; /* top line of scrolling region */ NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */ /* these are used only if this is a sub-window */ int _parx; /* x coordinate of this window in parent */ int _pary; /* y coordinate of this window in parent */ WINDOW *_parent; /* pointer to parent if a sub-window */ /* these are used only if this is a pad */ struct pdat { NCURSES_SIZE_T _pad_y, _pad_x; NCURSES_SIZE_T _pad_top, _pad_left; NCURSES_SIZE_T _pad_bottom, _pad_right; } _pad; NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */#ifdef _XOPEN_SOURCE_EXTENDED cchar_t _bkgrnd; /* current background char/attribute pair */#if @NCURSES_EXT_COLORS@ int _color; /* current color-pair for non-space character */#endif#endif};extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;extern NCURSES_EXPORT_VAR(WINDOW *) curscr;extern NCURSES_EXPORT_VAR(WINDOW *) newscr;extern NCURSES_EXPORT_VAR(int) LINES;extern NCURSES_EXPORT_VAR(int) COLS;extern NCURSES_EXPORT_VAR(int) TABSIZE;/* * This global was an undocumented feature under AIX curses. */extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility *//* * These functions are extensions - not in XSI Curses. */#if @NCURSES_EXT_FUNCS@extern NCURSES_EXPORT(bool) is_term_resized (int, int);extern NCURSES_EXPORT(char *) keybound (int, int);extern NCURSES_EXPORT(const char *) curses_version (void);extern NCURSES_EXPORT(int) assume_default_colors (int, int);extern NCURSES_EXPORT(int) define_key (const char *, int);extern NCURSES_EXPORT(int) key_defined (const char *);extern NCURSES_EXPORT(int) keyok (int, bool);extern NCURSES_EXPORT(int) resize_term (int, int);extern NCURSES_EXPORT(int) resizeterm (int, int);extern NCURSES_EXPORT(int) use_default_colors (void);extern NCURSES_EXPORT(int) use_extended_names (bool);extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);#else#define curses_version() NCURSES_VERSION#endif/* * This is an extension to support events... */#if @NCURSES_EXT_FUNCS@#ifdef NCURSES_WGETCH_EVENTS#if !defined(__BEOS__) /* Fix _nc_timed_wait() on BEOS... */# define NCURSES_EVENT_VERSION 1#endif /* !defined(__BEOS__) *//* * Bits to set in _nc_event.data.flags */# define _NC_EVENT_TIMEOUT_MSEC 1# define _NC_EVENT_FILE 2# define _NC_EVENT_FILE_READABLE 2# if 0 /* Not supported yet... */# define _NC_EVENT_FILE_WRITABLE 4# define _NC_EVENT_FILE_EXCEPTION 8# endiftypedef struct{ int type; union { long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ struct { unsigned int flags; int fd; unsigned int result; } fev; /* _NC_EVENT_FILE */ } data;} _nc_event;typedef struct{ int count; int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ _nc_event *events[1];} _nc_eventlist;extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *); /* experimental */extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */#endif /* NCURSES_WGETCH_EVENTS */#endif /* NCURSES_EXT_FUNCS *//* * GCC (and some other compilers) define '__attribute__'; we're using this * macro to alert the compiler to flag inconsistencies in printf/scanf-like * function calls. Just in case '__attribute__' isn't defined, make a dummy. * Old versions of G++ do not accept it anyway, at least not consistently with * GCC. */#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__))#define __attribute__(p) /* nothing */#endif/* * We cannot define these in ncurses_cfg.h, since they require parameters to be * passed (that's non-portable). */#ifndef GCC_PRINTFLIKE#if defined(GCC_PRINTF) && !defined(printf)#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))#else#define GCC_PRINTFLIKE(fmt,var) /*nothing*/#endif#endif#ifndef GCC_SCANFLIKE#if defined(GCC_SCANF) && !defined(scanf)#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))#else#define GCC_SCANFLIKE(fmt,var) /*nothing*/#endif#endif#ifndef GCC_NORETURN#define GCC_NORETURN /* nothing */#endif#ifndef GCC_UNUSED#define GCC_UNUSED /* nothing */#endif/* * Function prototypes. This is the complete XSI Curses list of required * functions. Those marked `generated' will have sources generated from the * macro definitions later in this file, in order to satisfy XPG4.2 * requirements. */extern NCURSES_EXPORT(int) addch (const chtype); /* generated */extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -