📄 rxvtlib.h
字号:
unsigned char *v_buffer, /* pointer to physical buffer */ *v_bufstr, /* beginning of area to write */ *v_bufptr, /* end of area to write */ *v_bufend; /* end of physical buffer */ /* * Data read from cmd_fd is buffered in here [Child's output buffer] */ unsigned char *cmdbuf_escstart, /* Start of an escape sequence */ *cmdbuf_escfail, /* Position where processing of an escape sequence last failed */ *cmdbuf_ptr, /* current char */ *cmdbuf_endp; /* End of read child's output */ unsigned char cmdbuf_base[BUFSIZ];} term_t;#define TAB_MON_OFF 0 /* tab monitoring off */#define TAB_MON_ACTIVITY 1 /* monitor for activity */#define TAB_MON_INACTIVITY 2 /* monitor for inactivity */#define TAB_MON_AUTO 3 /* automatic discovery of monitor type */#define TAB_MON_NOTIFICATION 4 /* inactivity/activity detected, notification needed *//* 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 macros.c */enum { MacroFnDummy=0, MacroFnEsc, MacroFnStr, MacroFnNewTab, MacroFnExec, MacroFnClose, MacroFnGoto, MacroFnMove, MacroFnScroll, MacroFnCopy, MacroFnPaste, MacroFnPasteFile, MacroFnMonitorTab, MacroFnToggleSubwin, MacroFnFont, MacroFnToggleVeryBold, MacroFnToggleBoldColors, MacroFnToggleVeryBright, MacroFnToggleTransp, MacroFnToggleBcst, MacroFnToggleHold, MacroFnToggleFullscreen, MacroFnRaise, MacroFnSetTitle, MacroFnUseFifo, MacroFnPrintScreen, MacroFnSaveConfig, MacroFnToggleMacros, NMACRO_FUNCS} macroFnNames;typedef unsigned char macro_priority_t;typedef struct { KeySym keysym; unsigned char modFlags; /* First 4 bits are the action order number. Last four bits are the modifiers */ macro_priority_t priority; 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 unsigned long fg_fade, bg_fade;# ifdef XFT_SUPPORT XftColor xftfg_fade, xftbg_fade;# endif int saveLines; unsigned char BOOLVAR( holdOption, 3 ); /* * 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; uint32_t Options[MAX_OPTION_ARRAY]; XSizeHints szHint; /* macros */ macros_t* macros; /* array of 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; unsigned long *pixColorsFocus, *pixColorsUnfocus; /* Arrays of size TOTAL_COLORS. Pixel colors to be used when focused / unfocussed. */ unsigned long *pixColors; /* Array of size TOTAL_COLORS */ int ntabs; /* Number of tabs created so far during process lifetime */ int fgbg_tabnum; /* (Global) tab number corresponding to which Color_fg/bg are set */#ifdef XFT_SUPPORT XftColor* xftColors; /* Array of size TOTAL_COLORS */ XftColor *xftColorsFocus, /* Same as above, but for Xft */ *xftColorsUnfocus;# endif 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 the X connection */ /* * term_t structures and pointers. * * 2006-08-18 gi1242 TODO: This should be an array that grows dynamically in * size. Plus we should only reserve enough memory for a our currently * displayed term structures. */ term_t vterm[MAX_PAGES]; term_t* vts[MAX_PAGES]; short tabClicked; /* Tab clicked by user. Used for moving tabs by drag and drop. */ unsigned char BOOLVAR( cleanDeadChilds, 1 ), /* True if we have marked some children as dead, but not called rxvt_clean_cmd_page() to clean them out */ BOOLVAR( gotEIO, 1 ); /* True if some read() got EIO */ short ndead_childs; /* number of children that have died */ short nAsyncChilds; /* Number of alive children launched via rxvt_async_exec */ short asyncChilds[MAX_CHILDS]; /* PIDS of children exec'ed via * rxvt_async_exec */ int num_fds; /* number of fd to monitor */#ifdef USE_FIFO int fifo_fd; /* fd to read macros from */ char fifo_buf[FIFO_BUF_SIZE]; /* Buffer size of data read from fifo_fd */ char *fbuf_ptr; /* Pointer where data from fifo_fd should be read */ char *fifo_name; /* Name of the fifo */#endif 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 VTFG_FADE(R, P) \ ((R)->profile[(P)].fg_fade)# define VTBG_FADE(R, P) \ ((R)->profile[(P)].bg_fade)# ifdef XFT_SUPPORT# define VTXFTFG_FADE(R, P) \ ((R)->profile[(P)].xftfg_fade)# define VTXFTBG_FADE(R, P) \ ((R)->profile[(P)].xftbg_fade)# 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)/* macros for private/saved mode of term_t */#define ISSET_PMODE(R, P, V) \ ((R)->vts[(P)]->PrivateModes & (V))#define SET_PMODE(R, P, V) \ ((R)->vts[(P)]->PrivateModes |= (V))#define UNSET_PMODE(R, P, V) \ ((R)->vts[(P)]->PrivateModes &= ~(V))#define ISSET_SMODE(R, P, V) \ ((R)->vts[(P)]->SavedModes & (V))#define SET_SMODE(R, P, V) \ ((R)->vts[(P)]->SavedModes |= (V))#define UNSET_SMODE(R, P, V) \ ((R)->vts[(P)]->SavedModes &= ~(V))/* Macro to determine weather we should the i-th tab or not */#define SHOULD_HOLD( r, i ) \ ( \ ( HOLD_ALWAYSBIT & PVTS((r),(i))->holdOption ) \ || \ ( \ ( HOLD_NORMALBIT & PVTS((r),(i))->holdOption ) \ && !WIFEXITED( PVTS((r),(i))->status ) \ ) \ || \ ( \ ( HOLD_STATUSBIT & PVTS((r),(i))->holdOption ) \ && WEXITSTATUS( PVTS((r),(i))->status ) != 0 \ ) \ )/***************************************************************************** * 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 + -