📄 rxvtlib.h
字号:
} save;/* this must be the same as struct selection from edit.h */struct edit_selection { unsigned char * text; int len;} edit_selection;struct _selection_t { unsigned char *text; /* selected text */ int len; /* length of selected text */ enum { SELECTION_CLEAR = 0, /* nothing selected */ SELECTION_INIT, /* marked a point */ SELECTION_BEGIN, /* started a selection */ SELECTION_CONT, /* continued selection */ SELECTION_DONE /* selection put in CUT_BUFFER0 */ } op; /* current operation */ short screen; /* screen being used */ short clicks; /* number of clicks */ row_col_t beg, mark, end;} selection;/* ------------------------------------------------------------------------- *//* screen_t flags */#define Screen_Relative (1<<0) /* relative origin mode flag */#define Screen_VisibleCursor (1<<1) /* cursor visible? */#define Screen_Autowrap (1<<2) /* auto-wrap flag */#define Screen_Insert (1<<3) /* insert mode (vs. overstrike) */#define Screen_WrapNext (1<<4) /* need to wrap for next char? */#define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap)/* ------------------------------------------------------------------------- * * MODULE VARIABLES * * ------------------------------------------------------------------------- */#ifdef INTERN_SCREEN# define EXTSCR#else/* changed `extern' to `' */# define EXTSCR#endif/* This tells what's actually on the screen */EXTSCR text_t **drawn_text;EXTSCR rend_t **drawn_rend;EXTSCR text_t **buf_text;EXTSCR rend_t **buf_rend;EXTSCR short *buf_tlen;EXTSCR char *tabs; /* a 1 for a location with a tab-stop */EXTSCR screen_t swap;EXTSCR int selection_style;#endif /* repeat inclusion protection *//* ways to deal with getting/setting termios structure */#ifdef HAVE_TERMIOS_H/* termios interface */# ifdef TCSANOW /* POSIX */# define GET_TERMIOS(fd,tios) tcgetattr (fd, tios)# define SET_TERMIOS(fd,tios) \ cfsetospeed (tios, BAUDRATE), \ cfsetispeed (tios, BAUDRATE), \ tcsetattr (fd, TCSANOW, tios)# else# ifdef TIOCSETA# define GET_TERMIOS(fd,tios) ioctl (fd, TIOCGETA, tios)# define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TIOCSETA, tios)# else# define GET_TERMIOS(fd,tios) ioctl (fd, TCGETS, tios)# define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TCSETS, tios)# endif# endif# define SET_TTYMODE(fd,tios) SET_TERMIOS (fd, tios)#else/* sgtty interface */struct _ttymode_t { struct sgttyb sg; struct tchars tc; struct ltchars lc; int line; int local;};# define SET_TTYMODE(fd,tt) \ tt->sg.sg_ispeed = tt->sg.sg_ospeed = BAUDRATE, \ ioctl (fd, TIOCSETP, &(tt->sg)), \ ioctl (fd, TIOCSETC, &(tt->tc)), \ ioctl (fd, TIOCSLTC, &(tt->lc)), \ ioctl (fd, TIOCSETD, &(tt->line)), \ ioctl (fd, TIOCLSET, &(tt->local))#endif /* HAVE_TERMIOS_H */#ifdef PTYS_ARE_PTMX# define _NEW_TTY_CTRL /* to get proper defines in <termios.h> */#endif/* #define DEBUG_TTYMODE *//* #define DEBUG_CMD *//* use the fastest baud-rate */#ifdef B38400# define BAUDRATE B38400#else# ifdef B19200# define BAUDRATE B19200# else# define BAUDRATE B9600# endif#endif/* Disable special character functions */#ifdef _POSIX_VDISABLE# define VDISABLE _POSIX_VDISABLE#else# define VDISABLE 255#endif/*----------------------------------------------------------------------* * system default characters if defined and reasonable */#ifndef CINTR# define CINTR '\003' /* ^C */#endif#ifndef CQUIT# define CQUIT '\034' /* ^\ */#endif#ifndef CERASE# ifdef linux# define CERASE '\177' /* ^? */# else# define CERASE '\010' /* ^H */# endif#endif#ifndef CKILL# define CKILL '\025' /* ^U */#endif#ifndef CEOF# define CEOF '\004' /* ^D */#endif#ifndef CSTART# define CSTART '\021' /* ^Q */#endif#ifndef CSTOP# define CSTOP '\023' /* ^S */#endif#ifndef CSUSP# define CSUSP '\032' /* ^Z */#endif#ifndef CDSUSP# define CDSUSP '\031' /* ^Y */#endif#ifndef CRPRNT# define CRPRNT '\022' /* ^R */#endif#ifndef CFLUSH# define CFLUSH '\017' /* ^O */#endif#ifndef CWERASE# define CWERASE '\027' /* ^W */#endif#ifndef CLNEXT# define CLNEXT '\026' /* ^V */#endif#ifndef VDISCRD# ifdef VDISCARD# define VDISCRD VDISCARD# endif#endif#ifndef VWERSE# ifdef VWERASE# define VWERSE VWERASE# endif#endif#define KBUFSZ 512 /* size of keyboard mapping buffer */#define STRING_MAX 512 /* max string size for process_xterm_seq() */#define ESC_ARGS 32 /* max # of args for esc sequences *//* a large REFRESH_PERIOD causes problems with `cat' */#define REFRESH_PERIOD 1#ifndef MULTICLICK_TIME# define MULTICLICK_TIME 500#endif#ifndef SCROLLBAR_INITIAL_DELAY# ifdef NEXT_SCROLLER# define SCROLLBAR_INITIAL_DELAY 20# else# define SCROLLBAR_INITIAL_DELAY 40# endif#endif#ifndef SCROLLBAR_CONTINUOUS_DELAY# define SCROLLBAR_CONTINUOUS_DELAY 2#endif/* time factor to slow down a `jumpy' mouse */#define MOUSE_THRESHOLD 50#define CONSOLE "/dev/console" /* console device *//* * key-strings: if only these keys were standardized <sigh> */#ifdef LINUX_KEYS# define KS_HOME "\033[1~" /* Home == Find */# define KS_END "\033[4~" /* End == Select */#else# define KS_HOME "\033[7~" /* Home */# define KS_END "\033[8~" /* End */#endif#ifdef SCROLL_ON_SHIFT# define SCROLL_SHIFTKEY (shft)#else# define SCROLL_SHIFTKEY 0#endif#ifdef SCROLL_ON_CTRL# define SCROLL_CTRLKEY (ctrl)#else# define SCROLL_CTRLKEY 0#endif#ifdef SCROLL_ON_META# define SCROLL_METAKEY (meta)#else# define SCROLL_METAKEY 0#endif#define IS_SCROLL_MOD (SCROLL_SHIFTKEY || SCROLL_CTRLKEY || SCROLL_METAKEY)struct XCNQueue_t { struct XCNQueue_t *next; short width, height;} *XCNQueue;/* * ESC-Z processing: * * By stealing a sequence to which other xterms respond, and sending the * same number of characters, but having a distinguishable sequence, * we can avoid having a timeout (when not under an rxvt) for every login * shell to auto-set its DISPLAY. * * This particular sequence is even explicitly stated as obsolete since * about 1985, so only very old software is likely to be confused, a * confusion which can likely be remedied through termcap or TERM. Frankly, * I doubt anyone will even notice. We provide a #ifdef just in case they * don't care about auto-display setting. Just in case the ancient * software in question is broken enough to be case insensitive to the 'c' * character in the answerback string, we make the distinguishing * characteristic be capitalization of that character. The length of the * two strings should be the same so that identical read(2) calls may be * used. */#define VT100_ANS "\033[?1;2c" /* vt100 answerback */#ifndef ESCZ_ANSWER# define ESCZ_ANSWER VT100_ANS /* obsolete ANSI ESC[c */#endif/* DEC private modes */#define PrivMode_132 (1LU<<0)#define PrivMode_132OK (1LU<<1)#define PrivMode_rVideo (1LU<<2)#define PrivMode_relOrigin (1LU<<3)#define PrivMode_Screen (1LU<<4)#define PrivMode_Autowrap (1LU<<5)#define PrivMode_aplCUR (1LU<<6)#define PrivMode_aplKP (1LU<<7)#define PrivMode_HaveBackSpace (1LU<<8)#define PrivMode_BackSpace (1LU<<9)#define PrivMode_ShiftKeys (1LU<<10)#define PrivMode_VisibleCursor (1LU<<11)#define PrivMode_MouseX10 (1LU<<12)#define PrivMode_MouseX11 (1LU<<13)#define PrivMode_scrollBar (1LU<<14)#define PrivMode_menuBar (1LU<<15)#define PrivMode_TtyOutputInh (1LU<<16)#define PrivMode_Keypress (1LU<<17)/* too annoying to implement X11 highlight tracking *//* #define PrivMode_MouseX11Track (1LU<<18) */#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11)#define PrivMode(test,bit) \ if (test) \ o->PrivateModes |= (bit); \ else \ o->PrivateModes &= ~(bit)#define PrivMode_Default \(PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor)/* command input buffering */#ifndef BUFSIZ# define BUFSIZ 4096#endif unsigned char cmdbuf_base[BUFSIZ], *cmdbuf_ptr, *cmdbuf_endp;#ifdef UTMP_SUPPORT# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)# error cannot build with utmp support - no utmp or utmpx struct found# endif# if defined(RXVT_UTMPX_FILE) && defined(HAVE_STRUCT_UTMPX)# define RXVT_UTMP_AS_UTMPX# else# if defined(RXVT_UTMP_FILE) && defined(HAVE_STRUCT_UTMP)# undef RXVT_UTMP_AS_UTMPX# endif# endif/* if you have both utmp and utmpx files lying around and are really * using utmp not utmpx, then uncomment the following line *//* #undef RXVT_UTMP_AS_UTMPX */# ifdef RXVT_UTMP_AS_UTMPX# define RXVT_REAL_UTMP_FILE RXVT_UTMPX_FILE# else# define RXVT_REAL_UTMP_FILE RXVT_UTMP_FILE# endif# ifdef RXVT_UTMP_AS_UTMPX# define USE_SYSV_UTMP# else# ifdef HAVE_SETUTENT# define USE_SYSV_UTMP# else# undef USE_SYSV_UTMP# endif# endif# undef UTMP# ifdef USE_SYSV_UTMP# ifndef USER_PROCESS# define USER_PROCESS 7# endif# ifndef DEAD_PROCESS# define DEAD_PROCESS 8# endif# ifdef RXVT_UTMP_AS_UTMPX# define UTMP struct utmpx# define setutent setutxent# define getutent getutxent# define getutid getutxid# define endutent endutxent# define pututline pututxline# endif# endif# ifndef UTMP# define UTMP struct utmp# endif# ifdef WTMP_SUPPORT# ifdef RXVT_UTMP_AS_UTMPX# define update_wtmp updwtmpx# ifdef RXVT_WTMPX_FILE# define RXVT_REAL_WTMP_FILE RXVT_WTMPX_FILE# else# error cannot build with wtmp support - no wtmpx file found# endif# else# define update_wtmp rxvt_update_wtmp# ifdef RXVT_WTMP_FILE# define RXVT_REAL_WTMP_FILE RXVT_WTMP_FILE# else# error cannot build with wtmp support - no wtmp file found# endif# endif# endif#endifstruct menuitem_t { struct menuitem_t *prev; /* prev menu-item */ struct menuitem_t *next; /* next menu-item */ char *name; /* character string displayed */ char *name2; /* character string displayed (right) */ short len; /* strlen (name) */ short len2; /* strlen (name) */ union { short type; /* must not be changed; first element */ struct _action_t { short type; /* must not be changed; first element */ short len; /* strlen (str) */ unsigned char *str; /* action to take */ } action; struct _submenu_t { short type; /* must not be changed; first element */ struct menu_t *menu; /* sub-menu */ } submenu; } entry;} *dummy_var3;enum menuitem_t_action { MenuLabel, MenuAction, MenuTerminalAction, MenuSubMenu} dummy_var4;struct bar_t { struct menu_t { struct menu_t *parent; /* parent menu */ struct menu_t *prev; /* prev menu */ struct menu_t *next; /* next menu */ menuitem_t *head; /* double-linked list */ menuitem_t *tail; /* double-linked list */ menuitem_t *item; /* current item */ char *name; /* menu name */ short len; /* strlen (name) */ short width; /* maximum menu width [chars] */ Window win; /* window of the menu */ short x; /* x location [pixels] (chars if parent == NULL) */ short y; /* y location [pixels] */ short w, h; /* window width, height [pixels] */ } *head, *tail; /* double-linked list of menus */ char *title; /* title to put in the empty menuBar */#if (MENUBAR_MAX > 1)# define MAXNAME 16 char name[MAXNAME]; /* name to use to refer to menubar */ struct bar_t *next, *prev; /* circular linked-list */#endif /* (MENUBAR_MAX > 1) */#define NARROWS 4 action_t arrows[NARROWS];} *CurrentBar;/* #define DEBUG_MENU *//* #define DEBUG_MENU_LAYOUT *//* #define DEBUG_MENUBAR_STACKING */#define HSPACE 1 /* one space */#define isSeparator(name) ((name)[0] == '\0')#define HEIGHT_SEPARATOR (SHADOW + 1)#define HEIGHT_TEXT (Height2Pixel(1) + 2)#define MENU_DELAY_USEC 250000 /* 1/4 sec */#define SEPARATOR_NAME "-"#define MENUITEM_BEG '{'#define MENUITEM_END '}'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -