📄 rxvtlib.h
字号:
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 */ /* moved from TermWin_t */ RUINT16T saveLines; /* number of lines to save */ RUINT16T num_scr; /* number of lines scrolled */ RUINT16T nscrolled; /* number of line actually scrolled */ RUINT16T view_start; /* scrollback view starts here */ RUINT16T 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; unsigned long p_bg;#ifdef XFT_SUPPORT XftColor p_xftfg; XftColor p_xftbg;#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; RUINT16T prev_ncol; /* previous columns */ RUINT16T prev_nrow; /* previous rows */ /* moved from tab_t */ short tab_width; /* tab width */ char UNTAINTED * tab_title; /* 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 */ unsigned long PrivateModes; unsigned long 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 */ char hold; /* the terminal is dead or alive? */ char dead; /* the terminal is highlighted? */ char BOOLVAR(highlight,1); /* the terminal TERM type */ termenv_t termenv; clock_t checksum; /* unique id of this terminal */ /* write out buffer */ unsigned char* v_buffer; /* pointer to physical buffer */ unsigned char* v_bufstr; /* beginning of area to write */ unsigned char* v_bufptr; /* end of area to write */ unsigned char* v_bufend; /* end of physical buffer */ /* command input buffering */ unsigned char* cmdbuf_ptr; unsigned char* cmdbuf_endp; unsigned char cmdbuf_base[BUFSIZ];} term_t;/* Possible values for macros.modFlags */#define MACRO_CTRL (1U << 0)#define MACRO_META (1U << 1)#define MACRO_SHIFT (1U << 2)#define MACRO_PRIMARY (1U << 3)/* Number of bits used by modifiers in modFlags */#define MACRO_N_MOD_BITS (4)#define MACRO_MODMASK \ ( MACRO_CTRL | MACRO_META | MACRO_SHIFT | MACRO_PRIMARY )#define MACRO_MAX_CHAINLEN (0xf)/* Get / set the macro number from modFlags */#define MACRO_GET_NUMBER(x) \ ( (x) & ~MACRO_MODMASK ) >> MACRO_N_MOD_BITS/* * Action to take when a macro is called / menu item is selected. */typedef struct { unsigned short type; /* must not be changed; first element */ unsigned short len; /* strlen (str) */ unsigned char *str; /* action to take */} action_t;/* Values for macro_t.type. Must sync this with macroNames from xdefaults.c */enum { MacroFnDummy=0, MacroFnEsc, MacroFnStr, MacroFnNewTab, MacroFnClose, MacroFnGoto, MacroFnMove, MacroFnScroll, MacroFnCopy, MacroFnPaste, MacroFnToggleSubwin, MacroFnFont, MacroFnToggleVeryBold, MacroFnToggleTransp, MacroFnToggleBcst, MacroFnToggleHold, MacroFnToggleFullscren, MacroFnSetTitle, MacroFnPrintScreen, MacroFnSaveConfig, MacroFnToggleMacros, NMACRO_FUNCS};typedef struct { KeySym keysym; unsigned char modFlags; /* First 4 bits are the action order number. Last four bits are the modifiers */ action_t action;} macros_t;/* * profile_t structure. Contains information about each profile (formerly the * vt%d.xx resources. */typedef struct _profile_t{ unsigned long fg, bg;#ifdef XFT_SUPPORT XftColor xftfg, xftbg;#endif int saveLines; /* * Each profile also has a tab title, and command associated to it. However * since that's already stored in our resource options, we don't need * pointers for it here. */} profile_t;typedef struct rxvt_vars { /* * These ``hidden'' items are not for public consumption and must not be * accessed externally * * 2006-02-19 gi1242: mrxvt was forked from rxvt. In rxvt, they compiled * common rxvt functions into a library "rxvtlib". Thus when loading * multiple versions of rxvt, this common code was linked to, saving some * memory. * * With tabs, we of course won't find this as useful. With grand dreams of * multiple windows, we'll never need it :). */ struct rxvt_hidden *h; /* * Exposed items * Changes to structure here require library version number change */ TermWin_t TermWin;#ifdef HAVE_SCROLLBARS scrollBar_t scrollBar;#endif#ifdef HAVE_MENUBAR menuBar_t menuBar;#endif tabBar_t tabBar; Display* Xdisplay; unsigned long Options; unsigned long Options2; XSizeHints szHint; /* macros */ macros_t *macros; /* array of all user defind macros */ unsigned short nmacros, /* Number of macros defined */ maxMacros; /* max # of macros that can be stored in memory pointed to by "macros" */ Colormap Xcmap;#ifdef OFF_FOCUS_FADING unsigned long *PixColorsUnfocus; /* Array of size TOTAL_COLORS */ /* PixColorsUnfocus and PixColor has been switched */ char color_switched;#endif /* Bg and UfBg has been switched */ char ufbg_switched; unsigned long *PixColors; /* Array of size TOTAL_COLORS */#ifdef XFT_SUPPORT XftColor* XftColors; /* number of colors + 2 * NPAGES */#endif short numPixColors; /* TOTAL_COLORS */ profile_t profile[MAX_PROFILES]; Cursor term_pointer; /* cursor for vt window */ int Xdepth; int sb_shadow; /* scrollbar shadow width */ int Xfd; /* file descriptor of X connection */ /* term_t structures and pointers */ term_t vterm[MAX_PAGES]; term_t* vts[MAX_PAGES]; short tabClicked; /* Tab clicked by user. Used for moving tabs by drag and dropping. */ /* number of children that have died */ short vt_died; int num_fds; /* number of fd to monitor */ selection_t selection; sstyle_t selection_style; int numlock_state; char* tabstop; /* per location: 1 == tab-stop */ enum enc_label encoding_method; char** global_argv; int global_argc;} rxvt_t;typedef enum { HIDE_MENUBAR = 0, SHOW_MENUBAR, HIDE_TABBAR, SHOW_TABBAR, HIDE_SCROLLBAR, SHOW_SCROLLBAR, RESIZE_FONT, X_CONFIGURE,} resize_reason_t;/* MACROS for colors of individual terminals */#if 0#define VTFG(R, P) \ ((R)->PixColors[TOTAL_COLORS + (P)])#define VTBG(R, P) \ ((R)->PixColors[TOTAL_COLORS + MAX_PAGES + (P)])#ifdef XFT_SUPPORT# define VTXFTFG(R, P) \ ((R)->XftColors[TOTAL_COLORS + (P)])# define VTXFTBG(R, P) \ ((R)->XftColors[TOTAL_COLORS + MAX_PAGES + (P)])#endif /* XFT_SUPPORT */#define ISSET_VTFG(R, P) \ (NULL != ((R)->h->rs[Rs_color + TOTAL_COLORS + (P)]))#define ISSET_VTBG(R, P) \ (NULL != ((R)->h->rs[Rs_color + TOTAL_COLORS + MAX_PAGES + (P)]))#endif#define VTFG(R, P) \ ((R)->profile[(P)].fg)#define VTBG(R, P) \ ((R)->profile[(P)].bg)#ifdef XFT_SUPPORT# define VTXFTFG(R, P) \ ((R)->profile[(P)].xftfg)# define VTXFTBG(R, P) \ ((R)->profile[(P)].xftbg)#endif /* XFT_SUPPORT */#define ISSET_VTFG(R, P) \ (NULL != ((R)->h->rs[Rs_foreground + (P)] ) )#define ISSET_VTBG(R, P) \ (NULL != ((R)->h->rs[Rs_background + (P)] ) )/* MACROS for tab/page number */#define ATAB(R) ((R)->tabBar.atab)#define LTAB(R) ((R)->tabBar.ltab)#define FVTAB(R) ((R)->tabBar.fvtab)#define LVTAB(R) ((R)->tabBar.lvtab)#define PTAB(R) ((R)->tabBar.ptab)#define APAGE(R) ((R)->tabBar.atab)#define LPAGE(R) ((R)->tabBar.ltab)#define FVPAGE(R) ((R)->tabBar.fvtab)#define LVPAGE(R) ((R)->tabBar.lvtab)#define PPAGE(R) ((R)->tabBar.ptab)/* MACROS for vts structure */#define AVTS(R) ((R)->vts[(R)->tabBar.atab])#define LVTS(R) ((R)->vts[(R)->tabBar.ltab])#define PVTS(R, P) ((R)->vts[(P)])#define SEL(R) ((R)->selection)#define ASCR(R) ((R)->vts[(R)->tabBar.atab]->screen)#define PSCR(R, P) ((R)->vts[(P)]->screen)/***************************************************************************** * PROTOTYPES * *****************************************************************************/void rxvt_main_loop(rxvt_t *);rxvt_t* rxvt_init (int, const char *const *);#endif /* __RXVTLIB_H__ *//*----------------------- end-of-file (H source) -----------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -