📄 rxvtlib.h
字号:
#define SET_ARRAYOPT( array, option ) \ ( (array)[ (option) & OPTION_MASK ] |= ( (option) & ~OPTION_MASK ) )#define UNSET_ARRAYOPT( array, option ) \ ( (array)[ (option) & OPTION_MASK ] &= ~( (option) & ~OPTION_MASK ) )#define TOGGLE_ARRAYOPT( array, option ) \ ( (array)[ (option) & OPTION_MASK ] ^= ( (option) & ~OPTION_MASK ) )/* Macros to manipulate standard options */#define ISSET_OPTION(R, OPT) \ ISSET_ARRAYOPT( (R)->Options, (OPT) )#define NOTSET_OPTION(R, OPT) \ !ISSET_OPTION( (R), (OPT) )#define SET_OPTION(R, OPT) \ SET_ARRAYOPT( (R)->Options, (OPT) )#define UNSET_OPTION(R, OPT) \ UNSET_ARRAYOPT( (R)->Options, (OPT) )#define TOGGLE_OPTION(R, OPT) \ TOGGLE_ARRAYOPT( (R)->Options, (OPT) )#define PROPFONT_NORMAL (1<<0)#define PROPFONT_BOLD (1<<1)#define PROPFONT_MULTI (1<<2)/* * Weather or not we should use xftPfont / xftpfont while drawing text. This has * ABSOLUTELY NOTHING to do with PROPFONT_* or the propfont junk. This is used * for drawing tab titles / menubar / etc. */#define NO_PFONT (0)#define USE_PFONT (1)#define USE_BOLD_PFONT (2)/* ------------------------------------------------------------------------- */#ifdef HAVE_MENUBARtypedef struct { short state; Window win; GC gc;# ifdef BACKGROUND_IMAGE Pixmap pixmap;# endif unsigned long fg; unsigned long bg; unsigned long topshadow; unsigned long botshadow;# ifdef XFT_SUPPORT XftDraw *xftDraw; XftColor xftFore;# endif} menuBar_t;#endif#ifdef HAVE_SCROLLBARStypedef struct { char state; /* scrollbar state */ char init; /* scrollbar has been initialised */ short beg; /* slider sub-window begin height */ short end; /* slider sub-window end height */ short top; /* slider top position */ short bot; /* slider bottom position */ short style; /* style: rxvt, xterm, next */ short width; /* scrollbar width */ Window win; int (*update)(struct rxvt_vars *, int, int, int, int); GC gc;# ifdef BACKGROUND_IMAGE Pixmap pixmap;# endif# ifdef RXVT_SCROLLBAR unsigned long rxvt_fg; unsigned long rxvt_bg; unsigned long rxvt_topshadow; unsigned long rxvt_botshadow;# endif# ifdef XTERM_SCROLLBAR unsigned long xterm_fg; unsigned long xterm_bg; unsigned long xterm_shadow;# endif# ifdef PLAIN_SCROLLBAR unsigned long plain_fg; unsigned long plain_bg;# endif# ifdef NEXT_SCROLLBAR unsigned long next_fg; /* black */ unsigned long next_bg; /* gray */ unsigned long next_white; unsigned long next_dark; GC next_stippleGC; Pixmap next_dimple, next_upArrow, next_upArrowHi, next_downArrow, next_downArrowHi;# endif# ifdef SGI_SCROLLBAR unsigned long sgi_fg; /* medium */ unsigned long sgi_bg; /* light */ unsigned long sgi_black; unsigned long sgi_white; unsigned long sgi_lmedium; unsigned long sgi_dark; unsigned long sgi_vdark; GC sgi_stippleGC; Pixmap sgi_dimple, sgi_upArrow, sgi_upArrowHi, sgi_upArrowLow, sgi_downArrow, sgi_downArrowHi, sgi_downArrowLow;# endif} scrollBar_t;#endif /* HAVE_SCROLLBARS */typedef struct { char state; /* tabbar state */ short ltab; /* last tab */ short atab; /* active tab */ short ptab; /* previous active tab */ short fvtab; /* first visible tab */ short lvtab; /* last visible tab */ Window win;#ifdef BACKGROUND_IMAGE Bool hasPixmap; /* has a background Pixmap */#endif GC gc; /* tab background/foreground, grey25/black */ unsigned long fg; /* foreground, black */ unsigned long bg; /* background, grey25 */ unsigned long ifg; /* inactive tab foreground, black */ unsigned long ibg; /* inactive tab background, grey */ char rsfg; /* fg resource has changed */ char rsbg; /* bg resource has changed */ char rsifg; /* ifg resource has changed */ char rsibg; /* ibg resource has changed */ unsigned long frame; /* tab frame, white */ unsigned long delimit; /* delimit, dark grey */#ifdef XFT_SUPPORT XftDraw* xftwin; /* XFT window */ XftColor xftfg; /* foreground */ XftColor xftifg; /* background */#endif} tabBar_t;#ifdef BACKGROUND_IMAGEtypedef struct { short w, h, x, y; Pixmap pixmap; } bgPixmap_t;#endif/* To suppress compile warning without xpm library */#ifdef BACKGROUND_IMAGE# ifndef HAVE_LIBXPM# define XpmCloseness (0)# define XpmColormap (0)# define XpmVisual (0)# define XpmDepth (0)# define XpmSize (0)# define XpmReturnPixels (0)typedef struct { unsigned long valuemask; Visual* visual; Colormap colormap; unsigned int depth; unsigned int width; unsigned int height; unsigned int closeness;} XpmAttributes;# endif /* HAVE_LIBXPM */#endif /* BACKGROUND_IMAGE */typedef enum { TERMENV_XTERM = 0, TERMENV_RXVT, TERMENV_VT102, TERMENV_VT100, TERMENV_ANSI, TERMENV_DUMB,} termenv_t;struct term_t;typedef struct { /* * Index to vts. If it's -1, then this term_t structure is not used. * Otherwise, it is used by pointer vts[vts_idx]. This is to improve destroy * performance so that we only need to do (i = page..ltab) vts[i] = vts[i+1] * instead of vterm[i] = vterm[i+1]. */ short vts_idx; unsigned char profileNum; /* Profile used to init settings */ int globalTabNum; /* Number of tabs created before this tab during this processes lifetime */ /* moved from TermWin_t */ uint16_t saveLines; /* number of lines to save */ uint16_t num_scr; /* number of lines scrolled */ uint16_t nscrolled; /* number of line actually scrolled */ uint16_t view_start; /* scrollback view starts here */ uint16_t mapped; /* window state mapped? */ /* screen structure initialized? */ unsigned char BOOLVAR(init_screen, 1); Window vt; /* terminal window */#ifdef XFT_SUPPORT XftDraw* xftvt;#endif#ifdef BACKGROUND_IMAGE Pixmap pixmap; /* background image, NOT used by */ bgPixmap_t bg; /* transparent window!!! */ XpmAttributes xpm_attr; /* original attr of image */#endif /* Apparently, people like fg/bg colors for individual terminal */ unsigned long p_fg, p_bg, p_fgfade, p_bgfade;#ifdef XFT_SUPPORT XftColor p_xftfg, p_xftbg, p_xftfgfade, p_xftbgfade;#endif /* moved from rxvt_t */ text_t** drawn_text; /* text drawn on screen (characters) */ rend_t** drawn_rend; /* text drawn on screen (rendition) */ text_t** buf_text; rend_t** buf_rend; screen_t screen;#if NSCREENS screen_t swap;#endif /* move from hidden */ rend_t rstyle; uint16_t prev_ncol; /* previous columns */ uint16_t prev_nrow; /* previous rows */ /* moved from tab_t */ short tab_width; /* tab width */ char UNTAINTED * tab_title; /* tab title */ char *title_format; /* Format to be used to display the tab title */ char *winTitleFormat; /* Format of the window title (used when syncing the tab title */ /* moved from rxvt_t */ int cmd_fd; /* pty file descriptor; connected to command */ int tty_fd; /* tty file descriptor; connected to child */ /* moved from hidden */ unsigned char BOOLVAR( current_screen, 1); /* PRIMARY / SECONDARY */#ifdef POINTER_BLANK unsigned char BOOLVAR( hidden_pointer, 1); /* pointer is hidden? */#endif pid_t cmd_pid; char* ttydev;#ifndef RESET_TTY_TO_COMMON_DEFAULTS struct stat ttyfd_stat; /* original status of our tty */#endif#ifndef NO_SETOWNER_TTYDEV unsigned char next_tty_action;#endif /* moved from hidden */ uint32_t PrivateModes; uint32_t SavedModes;#ifdef UTMP_SUPPORT#ifndef UTEMPTER_SUPPORT# ifdef HAVE_STRUCT_UTMP struct utmp ut;# endif# if defined(HAVE_STRUCT_UTMPX) && !defined(HAVE_STRUCT_UTMP) struct utmpx utx;# endif# if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) char ut_id[5];# endif int utmp_pos;#endif /* UTEMPTER_SUPPORT */ unsigned char next_utmp_action;#endif#if 0 char** command_argv; int command_argc;#endif /* move from rxvt_hidden */ ttymode_t tio; unsigned int ttymode; char rvideo;#ifdef MULTICHAR_SET char chstat, /* set ==> we only got half a glyph */ lost_multi, /* set ==> currently using 2 bytes per glyph */ multi_byte;#endif char charsets[4]; /* need to hold the terminal? * hold == 0: not hold * hold == 1: hold * hold > 1: can destroy the terminal now */ unsigned char BOOLVAR(hold,2), BOOLVAR(holdOption,3), /* Copy of the profile option for this tab.*/ BOOLVAR(gotEIO,1), /* Read on this terminal's fd got EIO */ BOOLVAR(dead,1), /* the terminal is dead or alive? */ BOOLVAR(highlight,1); /* the terminal is highlighted? */ int status; /* Status of child process after it exits */ /* the terminal TERM type */ termenv_t termenv; int scrolled_lines; /* If this tab is producing lots of data, this is the number of lines that have scrolled without a refresh request */ short monitor_tab; /* monitor tab status value, * see TAB_MON_* constants for possible values */ int monitor_nbytes_read; /* number of bytes read since monitor-start */ struct timeval monitor_start; /* epoch time of monitor starttime of the tab */ /* * Moved from hidden: want_refresh needs to be local to each tab. * want_full_refresh, refresh_type (except for SMOOTH_REFRESH), and * want_clip_refresh should be window (not tab) variables. */ unsigned char BOOLVAR( want_refresh, 1); /* Awaiting screen refresh */ int nbytes_last_read; /* Number of bytes read on the last read() call to child's fd */ /* * Data we want to write into cmd_fd is buffered in here, before being * written by rxvt_tt_write(). [Child's input buffer] */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -