⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rxvt.h

📁 multi-tabed terminal based on rxvt
💻 H
📖 第 1 页 / 共 4 页
字号:
#define Col2Pixel(col)	    ((int32_t)Width2Pixel(col) + (int32_t)r->TermWin.int_bwidth)#define Row2Pixel(row)	    ((int32_t)Height2Pixel(row) + (int32_t)r->TermWin.int_bwidth)/*#define TermWin_TotalWidth()	((int32_t)r->TermWin.width  + 2 * (int32_t)r->TermWin.int_bwidth)#define TermWin_TotalHeight()	((int32_t)r->TermWin.height + 2 * (int32_t)r->TermWin.int_bwidth)*//* how to build & extract colors and attributes */#define GET_BASEFG(x)	    (((x) & RS_fgMask))#define GET_BASEBG(x)	    (((x) & RS_bgMask)>>Color_Bits)#if 0 /* Was ifndef NO_BRIGHTCOLOR */# define GET_FGCOLOR(x)						    \    ((((x) & RS_Bold) == 0		    	    		    \      || GET_BASEFG(x) < minCOLOR		    		    \      || GET_BASEFG(x) >= minBrightCOLOR)	    		    \     ? GET_BASEFG(x)				    		    \     : (GET_BASEFG(x) + (minBrightCOLOR - minCOLOR)))# define GET_BGCOLOR(x)						    \    ((((x) & RS_Blink) == 0		    			    \      || GET_BASEBG(x) < minCOLOR				    \      || GET_BASEBG(x) >= minBrightCOLOR)			    \     ? GET_BASEBG(x)						    \     : (GET_BASEBG(x) + (minBrightCOLOR - minCOLOR)))#else# define GET_FGCOLOR(x)	    GET_BASEFG(x)# define GET_BGCOLOR(x)	    GET_BASEBG(x)#endif#define GET_ATTR(x)	(((x) & RS_attrMask))#define GET_BGATTR(x)				\    (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid))	\	    | (((x) & RS_fgMask)<<Color_Bits))	    \	     : ((x) & (RS_attrMask | RS_bgMask)))#define SET_FGCOLOR(x,fg)   (((x) & ~RS_fgMask)  | (fg))#define SET_BGCOLOR(x,bg)   (((x) & ~RS_bgMask)  | ((bg)<<Color_Bits))#define SET_ATTR(x,a)	    (((x) & ~RS_attrMask)| (a))#define SET_PIXCOLOR(h, x)	((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS)))#define ISSET_PIXCOLOR(h, x)	((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS)))#define scrollbar_isMotion()	(r->scrollBar.state == 'm')#define scrollbar_isUp()	(r->scrollBar.state == 'U')#define scrollbar_isDn()	(r->scrollBar.state == 'D')#define scrollbar_isUpDn()	isupper ((int) r->scrollBar.state)#define scrollbar_setIdle()	r->scrollBar.state = (char) 1#define scrollbar_setMotion()	r->scrollBar.state = 'm'#define scrollbar_setUp()	r->scrollBar.state = 'U'#define scrollbar_setDn()	r->scrollBar.state = 'D'#define scrollbarnext_dnval()	    (r->scrollBar.end + (r->scrollBar.width + 1))#define scrollbarnext_upButton(y)   ((y) > r->scrollBar.end \		     && (y) <= scrollbarnext_dnval())#define scrollbarnext_dnButton(y)   ((y) > scrollbarnext_dnval())#define scrollbarrxvt_upButton(y)   ((y) < r->scrollBar.beg)#define scrollbarrxvt_dnButton(y)   ((y) > r->scrollBar.end)#define scrollbarsgi_dnval()	    (r->scrollBar.end + 1)#define scrollbarsgi_upButton(y)    ((y) < r->scrollBar.beg)#define scrollbarsgi_dnButton(y)    ((y) > r->scrollBar.end)#ifdef NEXT_SCROLLBAR# define SCROLLNEXT_MINHEIGHT	    (NEXT_SB_MIN_HEIGHT)#else# define SCROLLNEXT_MINHEIGHT	    (0)#endif	/* NEXT_SCROLLBAR */#ifdef SGI_SCROLLBAR# define SCROLLSGI_MINHEIGHT	    (10)#else# define SCROLLSGI_MINHEIGHT	    (0)#endif	/* SGI_SCROLLBAR */#define SCROLL_MINHEIGHT	    (10)#define scrollbar_minheight()	(   \    (r->scrollBar.style == R_SB_NEXT) ? SCROLLNEXT_MINHEIGHT :	\    (r->scrollBar.style == R_SB_SGI) ? SCROLLSGI_MINHEIGHT :	\	SCROLL_MINHEIGHT)#define scrollbar_above_slider(y)   ((y) < r->scrollBar.top)#define scrollbar_below_slider(y)   ((y) > r->scrollBar.bot)#define scrollbar_position(y)	    ((y) - r->scrollBar.beg)#define scrollbar_size()	(r->scrollBar.end - r->scrollBar.beg \		     - scrollbar_minheight())#ifdef BACKGROUND_IMAGE# define XPMClearArea(a, b, c, d, e, f, g)  XClearArea((a), (b), (c), (d), (e), (f), (g))#else# define XPMClearArea(a, b, c, d, e, f, g)#endif#ifndef STRICT_FONT_CHECKING# define rxvt_get_fontwidest(font)  ((font)->max_bounds.width)#endif#define rxvt_Gr_ButtonPress(x,y)    rxvt_Gr_ButtonReport (r, 'P',(x),(y))#define rxvt_Gr_ButtonRelease(x,y)  rxvt_Gr_ButtonReport (r, 'R',(x),(y))/* * When sending a client message to an EWMH compatible window manager * e.g. calls to ewmh_message(). */#define _NET_WM_STATE_REMOVE	0#define _NET_WM_STATE_ADD	1#define _NET_WM_STATE_TOGGLE	2/* Values for holdOption */#define HOLD_ALWAYSBIT		(1u << 0)#define HOLD_NORMALBIT		(1u << 1)#define HOLD_STATUSBIT		(1u << 2)/* ***************************************************************************** * VARIABLES ***************************************************************************** */struct rxvt_hidden {    unsigned char   BOOLVAR( want_clip_refresh, 1),	/* Only refresh region							   specified by							   refreshRegion */		    BOOLVAR( want_resize, 2),		/* perform resize even							   if window size has							   not changed */#if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT)		    BOOLVAR( am_transparent, 1),	/* is transparent */		    BOOLVAR( am_pixmap_trans, 1),	/* transparency without							   known root pixmap */# endif#ifdef CURSOR_BLINK		    BOOLVAR( hidden_cursor, 1),#endif		    BOOLVAR( hate_those_clicks, 1),	/* a.k.a. keep mark							   position */		    BOOLVAR( num_scr_allow, 1),		    BOOLVAR( bypass_keystate, 1);#ifdef TRANSPARENT    unsigned char   BOOLVAR( want_full_refresh, 1);	/* awaiting full screen							   refresh, including							   borders. */#endif    Region	    refreshRegion;			/* Region for							   CLIPPED_REFRESH */    int		    skip_pages,				/* Number of pages to							   skip when jump							   scrolling */		    refresh_limit;			/* Request screen							   refresh only if ATAB							   produces <= these							   many chars */    unsigned char   BOOLVAR( refresh_type, 5),#ifdef META8_OPTION		    meta_char,				/* Alt-key prefix */#endif		    scrollbar_align,		    selection_wait,		    selection_type;#ifdef GREEK_SUPPORT    short	    greek_mode;				/* Greek keyboard							   mode */    KeySym	    ks_greekmodeswith;#endif    uint16_t	    prev_ncol,		    prev_nrow;				/* screen: previous							   number of columns and							   rows */    uint32_t	    pixcolor_set[NPIXCLR_SETS];#ifdef SELECTION_SCROLLING    int		    scroll_selection_delay,		    scroll_selection_lines;    enum page_dirn  scroll_selection_dir;    int		    selection_save_x,		    selection_save_y,		    selection_save_state,		    pending_scroll_selection;#endif    int		    csrO,				/* Hops - csr offset in							   thumb/slider to give							   proper Scroll							   behaviour */#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING		    scroll_arrow_delay,#endif#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)		    mouse_slip_wheel_delay,		    mouse_slip_wheel_speed,#endif		    max_skipped_pages,		    fnum,				/* logical font							   number */		    last_bot,				/* scrollbar last bottom							   position */		    last_top,				/* scrollbar last top							   position */		    last_state,				/* scrollbar last							   state */		    scroller_len,		    currmaxcol,		    window_vt_x,		    window_vt_y;# ifdef POINTER_BLANK    int		    pointerBlankDelay;# endif    unsigned char   BOOLVAR( allowedxerror, 1);		/* Be silent when							   reporting XErrors */    int		    xerror_return;			/* ErrorCode of caught							   XError */    unsigned int    ModMetaMask,		    ModNumLockMask;#ifndef NO_BRIGHTCOLOR    unsigned long   colorfgbg;#endif    gid_t	    ttygid;#ifdef PREFER_24BIT    Visual*	    Xvisual;#endif    Atom	    xa[NUM_XA];    Time            selection_time,                    selection_request_time;    Cursor          bar_pointer;#ifdef POINTER_BLANK    Cursor          blank_pointer;#endif#ifndef NO_BACKSPACE_KEY    const char*	    key_backspace;#endif#ifndef NO_DELETE_KEY    const char*	    key_delete;#endif#ifdef USE_XIM    XIC		    Input_Context;    XIMStyle	    input_style;    int		    event_type;#endif    struct mouse_event	MEvent;    row_col_t	    oldcursor;#ifdef MULTICHAR_SET    signed int	    oldcursormulti;#endif    void	    (*multichar_decode)(unsigned char *str, int len);#ifdef HAVE_MENUBAR    menu_t*	    ActiveMenu;				/* currently active							   menu */    menu_t*	    BuildMenu;				/* the menu currently							   being built */    menu_t*	    popupMenu[3];			/* Menus to popup on							   ctrl clicks */    unsigned char   BOOLVAR( showingMenu, 1);		/* The type of menu							   currently being							   shown */    bar_t	    MenuBar;    int		    Arrows_x;#endif#ifdef CURSOR_BLINK    long	    blinkInterval;    struct timeval  lastcursorchange;#endif#ifdef POINTER_BLANK    struct timeval  lastmotion;#endif#ifdef TRANSPARENT    unsigned long   bgRefreshInterval;    struct timeval  lastCNotify;			/* Time of the last							   CNotify event */#endif    struct timeval  timeout[NUM_TIMEOUTS];    /*     * These three don't need to be kept but do so to placate some memory     * checkers     */    char*	    env_windowid;			/* environmental							   variable WINDOWID */    char*	    env_display;			/* environmental							   variable DISPLAY */    char*	    env_term;				/* environmental							   variable TERM */    char*	    env_tabtitle;			/* environmental							   variable							   MRXVT_TABTITLE*/    char*	    env_colorfgbg;    char*	    buffer;    char*	    locale;#if 0    unsigned char*  v_buffer;    unsigned char*  v_bufstr;    unsigned char*  v_bufptr;    unsigned char*  v_bufend;#endif    char*	    newfont[MAX_NFONTS];    const char*	    rs[NUM_RESOURCES];#if 0    /* command input buffering */    unsigned char*  cmdbuf_ptr, *cmdbuf_endp;    unsigned char   cmdbuf_base[BUFSIZ];    unsigned char   kbuf[KBUFSZ];#endif#ifdef TRANSPARENT    Pixmap	rootPixmap;				/* Pixmap ID of the root							   pixmap */    unsigned	rpWidth,				/* Dimensions of the							   root pixmap */		rpHeight;    XRectangle	prevPos;				/* Previous onscreen							   position */    Bool	bgGrabbed;				/* whether the bg was							   succesfully grabbed							   at prevPos */#endif};#ifndef __attribute__# ifdef __GNUC__#  if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2)#   define __attribute__(x)#  endif# endif# define __attribute__(x)#endif/* ***************************************************************************** * PROTOTYPES ***************************************************************************** */#define __PROTO(p)  p#include "protos.h"#ifdef OUR_STRINGS# define MEMSET(x, y, z)	ma_memset((x), (y), (size_t)(z))# define MEMCPY(x, y, z)	ma_memcpy((void *)(x), (const void *)(y), (z))# define MEMMOVE(x, y, z)	ma_memmove((void *)(x), (const void *)(y), (z))# define STRCASECMP(x, y)	ma_strcasecmp((x), (y))# define STRNCASECMP(x, y, z)	ma_strncasecmp((x), (y), (z))# define STRCPY(x, y)		ma_strcpy((char *)(x), (const char *)(y))# define STRNCPY(x, y, z)	ma_strncpy((char *)(x), (const char *)(y), (z))# define STRCMP(x, y)		ma_strcmp((const char *)(x), (const char *)(y))# define STRNCMP(x, y, z)	ma_strncmp((const char *)(x), (const char *)(y), (z))# define STRCAT(x, y)		ma_strcat((char *)(x), (const char *)(y))# define STRNCAT(x, y, z)	ma_strncat((char *)(x), (const char *)(y), (z))# define STRDUP(x)		ma_strdup((const char *)(x))# define STRNDUP(x, z)		ma_strndup((const char TAINTED *)(x), (size_t) (z))# define STRLEN(x)		ma_strlen((const char *)(x))# define STRCHR(x, y)		ma_strchr((const char *)(x), (int)(y))# define STRRCHR(x, y)		ma_strrchr((const char *)(x), (int)(y))#else /* OUR_STRINGS */# define MEMSET(x, y, z)	memset((x), (y), (size_t)(z))# define MEMCPY(x, y, z)	memcpy((void *)(x), (const void *)(y), (z))# define MEMMOVE(x, y, z)	memmove((void *)(x), (const void *)(y), (z))# define STRCASECMP(x, y)	strcasecmp((x), (y))# define STRNCASECMP(x, y, z)	strncasecmp((x), (y), (z))# define STRCPY(x, y)		strcpy((char *)(x), (const char *)(y))# define STRNCPY(x, y, z)	strncpy((char *)(x), (const char *)(y), (z))# define STRCMP(x, y)		strcmp((const char *)(x), (const char *)(y))# define STRNCMP(x, y, z)	strncmp((const char *)(x), (const char *)(y), (z))# define STRCAT(x, y)		strcat((char *)(x), (const char *)(y))# define STRLEN(x)		strlen((const char *)(x))# define STRNCAT(x, y, z)	strncat((char *)(x), (const char *)(y), (z))/* if use our own malloc function, we must NOT use system provided * strdup or strndup because we want to free the memory allocated * by strdup/strndup using our free function */# if defined(HAVE_STRDUP) && !defined(OUR_MALLOC)#  define STRDUP(x)		strdup((const char *)(x))# else#  define STRDUP(x)		ma_strdup((const char *)(x))# endif# if defined(HAVE_STRNDUP) && !defined(OUR_MALLOC)#  define STRNDUP(x, z)		strndup((const char TAINTED *)(x), (size_t) (z))# else#  define STRNDUP(x, z)		ma_strndup((const char TAINTED *)(x), (size_t) (z))# endif# ifdef HAVE_STRCHR#  define STRCHR(x, y)		strchr((const char *)(x), (int)(y))# else#  define STRCHR(x, y)		ma_strchr((const char *)(x), (int)(y))# endif# ifdef HAVE_STRRCHR#  define STRRCHR(x, y)		strrchr((const char *)(x), (int)(y))# else#  define STRRCHR(x, y)		ma_strrchr((const char *)(x), (int)(y))# endif#endif	/* OUR_STRINGS */# define STRSTR(x, y)		strstr((const char *)(x), (const char*)(y))/* * strcasestr is not provided by Cygwin's libraries, so we have to check for it * here. Thanks to Teun Burgers for pointing this out. */# ifdef HAVE_STRCASESTR#  define STRCASESTR( x, y)	strcasestr( (x), (y) )# else#  define STRCASESTR( x, y)	ma_strcasestr( (x), (y))# endif#define TWIN_WIDTH(R)	((R)->szHint.width)#define TWIN_HEIGHT(R)	((R)->szHint.height)#define VT_WIDTH(R)	((R)->szHint.width - \	(R)->szHint.base_width + 2*(R)->TermWin.int_bwidth)#define VT_HEIGHT(R)	((R)->szHint.height - \	(R)->szHint.base_height + 2*(R)->TermWin.int_bwidth)/*#define TWIN_WIDTH(R)	\    ((R)->szHint.width - 2*(R)->TermWin.int_bwidth)#define TWIN_HEIGHT(R)	\    ((R)->szHint.height - 2*(R)->TermWin.int_bwidth)#define VT_WIDTH(R)	\    ((R)->szHint.width - (R)->szHint.base_width)#define VT_HEIGHT(R)	\    ((R)->szHint.height - (R)->szHint.base_height)*/#ifndef XTERM_COLOR_CHANGE# define rxvt_set_window_color(r, page, idx, color) ()#endif/* This comes last *//*#ifdef DEBUG_malloc# include "dmalloc.h"#endif*/#endif		    /* __RXVT_H__ *//*----------------------- end-of-file (H source) -----------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -