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

📄 rxvt.h

📁 multi-tabed terminal based on rxvt
💻 H
📖 第 1 页 / 共 4 页
字号:
#ifdef UTMP_SUPPORT# ifdef RXVT_UTMP_SYSV#  ifndef USER_PROCESS#   define USER_PROCESS	    (7)#  endif#  ifndef DEAD_PROCESS#   define DEAD_PROCESS	    (8)#  endif# endif#endif#ifdef NO_SECONDARY_SCREEN# define NSCREENS	0#else# define NSCREENS	1#endif/* * Let's try some interesting static program analysis tools. Refer to * http://www.cs.umd.edu/~jfoster/cqual/ * * Tainted defines the type of data that is fetchted from user input, which in * turn is unsafe without checking. Untainted defines the type of data that is * safe. */#ifdef __GNUC__# define $tainted# define $untainted# define TAINTED    $tainted# define UNTAINTED  $untainted#else# define TAINTED# define UNTAINTED#endif/************************************************************ The following are internal includes**********************************************************/#include "debug.h"#include "encoding.h"#include "rxvtlib.h"#ifdef GREEK_SUPPORT# include "grkelot.h"#endif#ifdef HAVE_MENUBAR# include "menubar.h"#endif#include "command.h"#include "init.h"#ifndef STDIN_FILENO# define STDIN_FILENO	0# define STDOUT_FILENO	1# define STDERR_FILENO	2#endif#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX)#  define NO_SETOWNER_TTYDEV# endif#endif#if defined(OS_CYGWIN) || defined(PTYS_ARE_OPENPTY)# define NO_SETOWNER_TTYDEV#endif/* Macros to check NULL pointers. This is solely to make the code more** readable/pretty*/#define IS_NULL(PTR)	(NULL == (PTR))#define NOT_NULL(PTR)	(NULL != (PTR))#define SET_NULL(PTR)	((PTR) = NULL)/* ***************************************************************************** * STRUCTURES AND TYPEDEFS ***************************************************************************** */struct rxvt_vars;	/* Later REDEFINED and typedef'd to rxvt_t */struct rxvt_hidden;/* Motif window hints, MwmHints.flags */#define MWM_HINTS_FUNCTIONS     (1L << 0)#define MWM_HINTS_DECORATIONS   (1L << 1)#define MWM_HINTS_INPUT_MODE    (1L << 2)#define MWM_HINTS_STATUS        (1L << 3)/* bit definitions for MwmHints.functions */#define MWM_FUNC_ALL            (1L << 0)#define MWM_FUNC_RESIZE         (1L << 1)#define MWM_FUNC_MOVE           (1L << 2)#define MWM_FUNC_MINIMIZE       (1L << 3)#define MWM_FUNC_MAXIMIZE       (1L << 4)#define MWM_FUNC_CLOSE          (1L << 5)/* bit definitions for MwmHints.decorations */#define MWM_DECOR_ALL           (1L << 0)#define MWM_DECOR_BORDER        (1L << 1)#define MWM_DECOR_RESIZEH       (1L << 2)#define MWM_DECOR_TITLE         (1L << 3)#define MWM_DECOR_MENU          (1L << 4)#define MWM_DECOR_MINIMIZE      (1L << 5)#define MWM_DECOR_MAXIMIZE      (1L << 6)/* bit definitions for MwmHints.inputMode */#define MWM_INPUT_MODELESS                  0#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1#define MWM_INPUT_SYSTEM_MODAL              2#define MWM_INPUT_FULL_APPLICATION_MODAL    3#define PROP_MWM_HINTS_ELEMENTS             5/* * If we're using either the rxvt scrollbar or menu bars, keep the * scrollColor resource. */#if defined(RXVT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) || defined(HAVE_MENUBAR)# define KEEP_SCROLLCOLOR 1#else# undef KEEP_SCROLLCOLOR#endif/* * the 'essential' information for reporting Mouse Events * pared down from XButtonEvent */struct mouse_event {    int             clicks;    Time            time;   /* milliseconds */    unsigned int    state;  /* key or button mask */    unsigned int    button; /* detail */};#ifndef min# define min(a,b)   (((a) < (b)) ? (a) : (b))# define max(a,b)   (((a) > (b)) ? (a) : (b))#endif#define MAX_IT(current, other)	if ((other) > (current)) (current) = (other)#define MIN_IT(current, other)	if ((other) < (current)) (current) = (other)#define SWAP_IT(one, two, typeof)				    \    {								    \	typeof          swapittmp;				    \	(swapittmp) = (one); (one) = (two); (two) = (swapittmp);    \    }#define BOUND_POSITIVE_INT16(val)				    \    (int16_t)( (val) <= 0 ? 0 : min( (val), (((uint16_t)-1)>>1) )  )/* ***************************************************************************** * NORMAL DEFINES ***************************************************************************** */#if defined (NO_OLD_SELECTION) && defined(NO_NEW_SELECTION)# error if you disable both selection styles, how can you select, silly?#endif#define APL_CLASS	"XTerm"	    /* class name */#define APL_SUBCLASS	"Mrxvt"	/* also check resources under this name */#define APL_NAME	"mrxvt"	/* normal name *//* COLORTERM, TERM environment variables */#define COLORTERMENV	"rxvt"#ifdef BACKGROUND_IMAGE# define COLORTERMENVFULL COLORTERMENV "-xpm"#else# define COLORTERMENVFULL COLORTERMENV#endif#ifndef TERMENV# define TERMENV	"xterm"#endif#define TABTITLEENV	"MRXVT_TABTITLE="#if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR)# define NO_MOUSE_REPORT_SCROLLBAR#endif#ifdef NO_RESOURCES# undef USE_XGETDEFAULT#endif/* now look for other badly set stuff */#if !defined (EACCESS) && defined(EAGAIN)# define EACCESS EAGAIN#endif#ifndef EXIT_SUCCESS	    /* missing from <stdlib.h> */# define EXIT_SUCCESS	    0	/* exit function success */# define EXIT_FAILURE	    1	/* exit function failure */#endif#define menuBar_esc	    (10)#define scrollBar_esc	    (30)#define MENUBAR_MARGIN	    (2)	/* margin below text *//* width of scrollBar, menuBar shadow, must be 1 or 2 */#ifdef HALFSHADOW# define SHADOW		    (1)#else# define SHADOW		    (2)#endif#define R_SB_ALIGN_CENTRE   (0)#define R_SB_ALIGN_TOP	    (1)#define R_SB_ALIGN_BOTTOM   (2)#define R_SB_UNKNOWN	    (-1)#define R_SB_RXVT	    (0)#define R_SB_NEXT	    (1)#define R_SB_XTERM	    (2)#define R_SB_SGI	    (3)#define R_SB_PLAIN	    (4)#define SB_WIDTH_PLAIN	    (15)#define SB_WIDTH_XTERM	    (15)#define SB_WIDTH_RXVT	    (10)#define SB_WIDTH_NEXT	    (17)#define SB_WIDTH_SGI	    (16)#ifdef NEXT_SCROLLBAR/*** NeXT scrollbar definitions*/#define NEXT_SB_WIDTH		(SB_WIDTH_NEXT)#define NEXT_SB_PAD		(1)#define NEXT_SB_BD_WIDTH	(1)#define NEXT_BEVEL_ULEFT_WIDTH	(1)#define NEXT_BEVEL_LRIGHT_WIDTH	(2)#define NEXT_SB_LPAD		(NEXT_SB_PAD + NEXT_SB_BD_WIDTH)#define NEXT_SB_MARGIN		(NEXT_SB_PAD<<1)#define NEXT_SB_BTN_WIDTH	(NEXT_SB_WIDTH - NEXT_SB_MARGIN - NEXT_SB_BD_WIDTH)/* button height */#define NEXT_SB_BTN_HEIGHT	(NEXT_SB_BTN_WIDTH)/* single button height */#define NEXT_SB_SBTN_HEIGHT	(NEXT_SB_BTN_HEIGHT + NEXT_SB_PAD)/* double button height */#define NEXT_SB_DBTN_HEIGHT	(NEXT_SB_SBTN_HEIGHT<<1)/* total button height */#define NEXT_SB_TBTN_HEIGHT	(NEXT_SB_DBTN_HEIGHT + NEXT_SB_PAD)#define NEXT_BEVEL_X		(NEXT_SB_LPAD)#define NEXT_BTN_FACE_X		(NEXT_BEVEL_X + NEXT_BEVEL_ULEFT_WIDTH)#define NEXT_SB_MIN_HEIGHT	(NEXT_SB_BTN_WIDTH - (NEXT_SB_PAD<<1)) /*  *    +-------------+  *    |             | <---< NEXT_SB_PAD  *    | ::::::::::: |  *    | ::::::::::: |  *   '''''''''''''''''  *   ,,,,,,,,,,,,,,,,,  *    | ::::::::::: |  *    | ::::::::::: |  *    |  +---------------< NEXT_BEVEL_ULEFT_WIDTH  *    |  | :::::::: |  *    |  V :::: vv-------< NEXT_BEVEL_LRIGHT_WIDTH  *    | +---------+ |  *    | | ......%%| |  *    | | ......%%| |  *    | | ..()..%%| |  *    | | ......%%| |  *    | | %%%%%%%%| |  *    | +---------+ | <.........................  *    |             | <---< NEXT_SB_PAD         :  *    | +---------+ | <-+..........            :---< NEXT_SB_TBTN_HEIGHT  *    | | ......%%| |   |         :            :  *    | | ../\..%%| |   |---< NEXT_SB_BTN_HEIGHT :  *    | | %%%%%%%%| |   |         :            :  *    | +---------+ | <-+         :            :  *    |             |             :            :  *    | +---------+ | <-+         :---< NEXT_SB_DBTN_HEIGHT  *    | | ......%%| |   |         :            :  *    | | ..\/..%%| |   |         :            :  *    | | %%%%%%%%| |   |---< NEXT_SB_SBTN_HEIGHT  *    | +---------+ |   |         :            :  *    |             |   |         :            :  *    +-------------+ <-+.........:............:  *    ^^|_________| :  *    ||     |      :  *    ||     +---< NEXT_SB_BTN_WIDTH  *    ||            :  *    |+------< NEXT_SB_PAD  *    |:            :  *    +----< NEXT_SB_BD_WIDTH  *     :            :  *     :............:  *           |  *           +---< NEXT_SB_WIDTH  */#endif	/* NEXT_SCROLLBAR */#ifdef SGI_SCROLLBAR/*** SGI IRIX scrollbar definitions*/#define SGI_ARROW_SOURCE_WIDTH	(14)#define SGI_ARROW_SOURCE_HEIGHT	(14)#define SGI_BEVEL_HI_WIDTH	(1)#define SGI_BEVEL_LO_WIDTH	(1)#define SGI_BEVEL_SIZE		(SGI_BEVEL_HI_WIDTH+SGI_BEVEL_LO_WIDTH)#define SGI_ARROW_WIDTH		(SB_WIDTH_SGI-(SGI_BEVEL_SIZE<<1))#define SGI_ARROW_HEIGHT	(SGI_ARROW_SOURCE_HEIGHT)#define SGI_SB_BUTTON_HEIGHT	((SGI_BEVEL_SIZE<<1)+SGI_ARROW_WIDTH)#define SGI_SB_BUTTONS_HEIGHT	(SGI_SB_BUTTON_HEIGHT<<1)#endif/* * Options for r->h->refresh_type. */#define NO_REFRESH	    (0)	    /* Window not visible at all! */#define FAST_REFRESH	    (1<<0)  /* Fully exposed window */#define SLOW_REFRESH	    (1<<1)  /* Partially exposed window */#define SMOOTH_REFRESH	    (1<<2)  /* Do sync'ing to make it smooth */#define REFRESH_BOUNDS	    (1<<3)  /* Refresh window borders */#define CLIPPED_REFRESH	    (1<<4)  /* Honor clipping in GC while refreshing *//* * Options for r->h->want_resize */#define FORCE_RESIZE	    (1U << 0)#define FORCE_REFRESH	    (1U << 1)/* * Continue undocumented mrxvt code */#define IGNORE		0#define SAVE		's'#define RESTORE		'r'/* special (internal) prefix for font commands */#define FONT_CMD	'#'#define FONT_DN		"#-"#define FONT_UP		"#+"/* flags for rxvt_scr_gotorc() */#define C_RELATIVE	1   /* col movement is relative */#define R_RELATIVE	2   /* row movement is relative */#define RELATIVE	(R_RELATIVE|C_RELATIVE)/* modes for rxvt_scr_insdel_chars(), rxvt_scr_insdel_lines() */#define INSERT		-1  /* don't change these values */#define DELETE		+1#define ERASE		+2/* modes for rxvt_scr_page() - scroll page. used by scrollbar window */enum page_dirn {    UP,    DN,    NO_DIR};/* arguments for rxvt_scr_change_screen() */#define PRIMARY	    (0)#define SECONDARY   (1)enum {    SBYTE = 0,    WBYTE};#define RS_None		0   /* Normal */#if defined(TTY_256COLOR)/* have at least 32 bits to use */# define RS_fgMask	    0x000001FFu	/* 512 colors */# define RS_bgMask	    0x0003FE00u	/* 512 colors */# define RS_Bold	    0x00040000u	/* bold */# define RS_Blink	    0x00080000u	/* blink */# define RS_RVid	    0x00100000u	/* reverse video */# define RS_Uline	    0x00200000u	/* underline */# define RS_acsFont	    0x00400000u	/* ACS graphics char set */# define RS_ukFont	    0x00800000u	/* UK character set */#else/* may only have 16 bits to use so squash them in */# define RS_fgMask	    0x0000001Fu	/* 32 colors */# define RS_bgMask	    0x000003E0u	/* 32 colors */# define RS_Bold	    0x00000400u	/* bold */# define RS_Blink	    0x00000800u	/* blink */# define RS_RVid	    0x00001000u	/* reverse video */# define RS_Uline	    0x00002000u	/* underline */# define RS_acsFont	    0x00004000u	/* ACS graphics char set */# define RS_ukFont	    0x00008000u	/* UK character set */#endif#ifdef MULTICHAR_SET# define RS_multi0	    0x10000000u	/* only multibyte characters */# define RS_multi1	    0x20000000u	/* multibyte 1st byte *//* multibyte 2nd byte */# define RS_multi2	    (RS_multi0|RS_multi1)/* multibyte mask */# define RS_multiMask	    (RS_multi0|RS_multi1)# define IS_MULTI1(R)	    (((R) & RS_multiMask) == RS_multi1)# define IS_MULTI2(R)	    (((R) & RS_multiMask) == RS_multi2)#else# define RS_multiMask	    (0)# define IS_MULTI1(r)	    (0)# define IS_MULTI2(r)	    (0)#endif#define UNICODE_MASK 0x1fffffUL#if UNICODE3# define COMPOSE_LO 0x40000000UL# define COMPOSE_HI 0x400fffffUL# define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO)#else# define COMPOSE_LO 0xd800UL# define COMPOSE_HI 0xf8ffUL /* dfff should be safer, but... */# define IS_COMPOSE(n) (COMPOSE_LO <= (n) && (n) <= COMPOSE_HI)#endif#define RS_fontMask	    (RS_acsFont|RS_ukFont)#define RS_baseattrMask	    (RS_Bold|RS_Blink|RS_RVid|RS_Uline)#define RS_attrMask	    (RS_baseattrMask|RS_fontMask|RS_multiMask)#define Sel_none	    0	/* Not waiting */#define Sel_normal	    0x01    /* normal selection */#define Sel_incr	    0x02    /* incremental selection */#define Sel_direct	    0x00#define Sel_Primary	    0x01#define Sel_Secondary	    0x02#define Sel_Clipboard	    0x03#define Sel_whereMask	    0x0f#define Sel_CompoundText    0x10    /* last request was Compound */enum {    C0_NUL = 0x00,            C0_SOH, C0_STX, C0_ETX, C0_EOT, C0_ENQ, C0_ACK, C0_BEL,    C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI ,    C0_DLE, C0_DC1, C0_DC2, D0_DC3, C0_DC4, C0_NAK, C0_SYN, C0_ETB,    C0_CAN, C0_EM , C0_SUB, C0_ESC, C0_IS4, C0_IS3, C0_IS2, C0_IS1}; #define CHAR_ST		0x9c	/* 0234 *//*** Xwsh escape sequences: ESC P Ps .y Pt ESC

⌨️ 快捷键说明

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