📄 rxvtlib.h
字号:
Color_Magenta3, Color_Cyan3, maxCOLOR, /* minCOLOR + 7 */#ifndef NO_BRIGHTCOLOR Color_AntiqueWhite = maxCOLOR, minBrightCOLOR, /* maxCOLOR + 1 */ Color_Grey25 = minBrightCOLOR, Color_Red, Color_Green, Color_Yellow, Color_Blue, Color_Magenta, Color_Cyan, maxBrightCOLOR, /* minBrightCOLOR + 7 */ Color_White = maxBrightCOLOR,#else Color_White = maxCOLOR,#endif#ifndef NO_CURSORCOLOR Color_cursor, Color_cursor2,#endif Color_pointer, Color_border,#ifndef NO_BOLDUNDERLINE Color_BD, Color_UL,#endif#ifdef KEEP_SCROLLCOLOR Color_scroll, Color_trough,#endif NRS_COLORS, /* */#ifdef KEEP_SCROLLCOLOR Color_topShadow = NRS_COLORS, Color_bottomShadow, TOTAL_COLORS /* upto 28 */#else TOTAL_COLORS = NRS_COLORS /* */#endif} dummy_var;#define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<5))/* * This resource list should match xdefaults.c * - though not necessarily in order */enum Rs_resource_list { Rs_display_name = 0, Rs_term_name, Rs_geometry, Rs_reverseVideo, Rs_color, Rs_font = Rs_color + NRS_COLORS, Rs_iconName = Rs_font + NFONTS,#ifdef MULTICHAR_SET Rs_mfont, Rs_multichar_encoding = Rs_mfont + NFONTS,#endif Rs_name, Rs_title,#if defined (XPM_BACKGROUND) || (MENUBAR_MAX) Rs_path,#endif#ifdef XPM_BACKGROUND Rs_backgroundPixmap,#endif#if (MENUBAR_MAX) Rs_menu,#endif#ifndef NO_BOLDFONT Rs_boldFont,#endif#ifdef GREEK_SUPPORT Rs_greek_keyboard,#endif Rs_loginShell, Rs_scrollBar, Rs_scrollBar_right, Rs_scrollBar_floating, Rs_scrollTtyOutput, Rs_scrollKeypress, Rs_saveLines, Rs_utmpInhibit, Rs_visualBell,#if ! defined(NO_MAPALERT) && defined(MAPALERT_OPTION) Rs_mapAlert,#endif#ifdef META8_OPTION Rs_meta8,#endif#ifndef NO_BACKSPACE_KEY Rs_backspace_key,#endif#ifndef NO_DELETE_KEY Rs_delete_key,#endif Rs_selectstyle,#ifdef PRINTPIPE Rs_print_pipe,#endif#ifdef USE_XIM Rs_preeditType, Rs_inputMethod,#endif#if defined (HOTKEY_CTRL) || defined (HOTKEY_META) Rs_bigfont_key, Rs_smallfont_key,#endif#ifdef TRANSPARENT Rs_transparent,#endif Rs_cutchars, Rs_modifier, TOTAL_RS} dummy_var2;/* * number of graphics points * divisible by 2 (num lines) * divisible by 4 (num rect) */#define NGRX_PTS 1000/* ***************************************************************************** * MACRO DEFINES ***************************************************************************** */#define STRCPY(a, b) strcpy ((char *)(a), (const char *) (b))#define STRNCPY(a, b, c) strncpy ((char *)(a), (const char *) (b), (c))#ifdef NO_RMEMSET# define MEMSET(a, b, c) memset ((a), (b), (c))#else# define MEMSET(a, b, c) rmemset ((a), (b), (intp_t) (c))#endif#define MALLOC(sz) malloc (sz)#define CALLOC(type, n) calloc ((n), sizeof(type))#define REALLOC(mem, sz) ((mem) ? realloc ((mem), (sz)) : malloc(sz))#define FREE(ptr) free (ptr)/* convert pixel dimensions to row/column values */#define Pixel2Col(x) Pixel2Width((x) - TermWin_internalBorder)#define Pixel2Row(y) Pixel2Height((y) - TermWin_internalBorder)#define Pixel2Width(x) ((x) / o->TermWin.fwidth)#define Pixel2Height(y) ((y) / o->TermWin.fheight)#define Col2Pixel(col) (Width2Pixel(col) + TermWin_internalBorder)#define Row2Pixel(row) (Height2Pixel(row) + TermWin_internalBorder)#define Width2Pixel(n) ((n) * o->TermWin.fwidth)#define Height2Pixel(n) ((n) * o->TermWin.fheight)#define TermWin_TotalWidth() (o->TermWin.width + 2 * TermWin_internalBorder)#define TermWin_TotalHeight() (o->TermWin.height + 2 * TermWin_internalBorder)#define Xscreen DefaultScreen(o->Xdisplay)#define Xroot DefaultRootWindow(o->Xdisplay)/* how to build & extract colors and attributes */#define GET_FGCOLOR(r) (((r) & RS_fgMask))#define GET_BGCOLOR(r) (((r) & RS_bgMask)>>5)#define GET_ATTR(r) (((r) & RS_attrMask))#define GET_BGATTR(r) \ (((r) & RS_RVid) ? (((r) & (RS_attrMask & ~RS_RVid)) \ | (((r) & RS_fgMask)<<5)) \ : ((r) & (RS_attrMask | RS_bgMask)))#define SET_FGCOLOR(r,fg) (((r) & ~RS_fgMask) | (fg))#define SET_BGCOLOR(r,bg) (((r) & ~RS_bgMask) | ((bg)<<5))#define SET_ATTR(r,a) (((r) & ~RS_attrMask)| (a))#define scrollbar_visible() (o->scrollBar.state)#define scrollbar_isMotion() (o->scrollBar.state == 'm')#define scrollbar_isUp() (o->scrollBar.state == 'U')#define scrollbar_isDn() (o->scrollBar.state == 'D')#define scrollbar_isUpDn() isupper (o->scrollBar.state)#define isScrollbarWindow(w) (scrollbar_visible() && (w) == o->scrollBar.win)#define scrollbar_setNone() o->scrollBar.state = 1#define scrollbar_setMotion() o->scrollBar.state = 'm'#define scrollbar_setUp() o->scrollBar.state = 'U'#define scrollbar_setDn() o->scrollBar.state = 'D'#ifdef NEXT_SCROLLBAR# define scrollbar_dnval() (o->scrollBar.end + (SB_WIDTH + 1))# define scrollbar_upButton(y) ((y) > o->scrollBar.end \ && (y) <= scrollbar_dnval())# define scrollbar_dnButton(y) ((y) > scrollbar_dnval())# define SCROLL_MINHEIGHT SB_THUMB_MIN_HEIGHT#else# define scrollbar_upButton(y) ((y) < o->scrollBar.beg)# define scrollbar_dnButton(y) ((y) > o->scrollBar.end)# define SCROLL_MINHEIGHT 10#endif#define scrollbar_above_slider(y) ((y) < o->scrollBar.top)#define scrollbar_below_slider(y) ((y) > o->scrollBar.bot)#define scrollbar_position(y) ((y) - o->scrollBar.beg)#define scrollbar_size() (o->scrollBar.end - o->scrollBar.beg - SCROLL_MINHEIGHT)#if (MENUBAR_MAX > 1)/* rendition style flags */# define menubar_visible() (o->menuBar.state)# define menuBar_height() (o->TermWin.fheight + SHADOW)# define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin)# define isMenuBarWindow(w) ((w) == o->menuBar.win)#else# define isMenuBarWindow(w) (0)# define menuBar_height() (0)# define menuBar_TotalHeight() (0)# define menubar_visible() (0)#endif#ifdef XPM_BACKGROUND# 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#define Gr_ButtonPress(x,y) rxvtlib_Gr_ButtonReport (o, 'P',(x),(y))#define Gr_ButtonRelease(x,y) rxvtlib_Gr_ButtonReport (o, 'R',(x),(y))/* ***************************************************************************** * VARIABLES ***************************************************************************** */#ifdef INTERN# define EXTERN#else/* change `extern' to `' */# define EXTERN#endif#ifdef PREFER_24BITEXTERN Colormap Xcmap;EXTERN int Xdepth;EXTERN Visual *Xvisual;#else# define Xcmap DefaultColormap(Xdisplay,Xscreen)# define Xdepth DefaultDepth(Xdisplay,Xscreen)# define Xvisual DefaultVisual(Xdisplay,Xscreen)# ifdef DEBUG_DEPTH# undef Xdepth# define Xdepth DEBUG_DEPTH# endif#endifEXTERN Display *Xdisplay;EXTERN unsigned long Options;EXTERN XSizeHints szHint;EXTERN int sb_shadow;EXTERN Pixel PixColors[TOTAL_COLORS];#ifdef INEXPENSIVE_LOCAL_X_CALLSEXTERN int display_is_local;#endifEXTERN short want_refresh;EXTERN char *rs[TOTAL_RS];EXTERN char *rs_free[TOTAL_RS];#ifndef NO_BACKSPACE_KEYEXTERN const char *key_backspace;#endif#ifndef NO_DELETE_KEYEXTERN const char *key_delete;#endif#ifndef NO_BRIGHTCOLOREXTERN unsigned int colorfgbg;#endif#ifdef KEYSYM_RESOURCEEXTERN const unsigned char *KeySym_map[256];#endif#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)EXTERN KeySym ks_bigfont;EXTERN KeySym ks_smallfont;#endif/* ***************************************************************************** * PROTOTYPES ***************************************************************************** */#ifdef PROTOTYPES# define __PROTO(p) p#else# define __PROTO(p) ()#endif/* * If we haven't pulled in typedef's like short , then do them ourself *//* type of (normal and unsigned) basic sizes *//* e.g. typedef short short *//* e.g. typedef unsigned short u_short *//* e.g. typedef int int32_t *//* e.g. typedef unsigned int u_int32_t *//* e.g. typedef long int64_t *//* e.g. typedef unsigned long u_int64_t *//* whatever normal size corresponds to a integer pointer */#define intp_t unsigned int/* whatever normal size corresponds to a unsigned integer pointer */#define u_intp_t unsigned int#ifdef STANDALONE#undef VERSION#define VERSION "2.6.2"#endif#define DATE "17 AUGUST 1999"#define LSMDATE "17AUG99"/* Include prototypes for all files *//* * $Id: protos.h,v 1.7 1998/10/24 10:22:45 mason Exp $ *//*--------------------------------*-C-*---------------------------------* * File: rxvtgrx.h * $Id: rxvtgrx.h,v 1.2 1998/04/20 07:27:05 mason Exp $ * * Stuff for text alignment for rxvt special graphics mode * * alignment * Top: * text is placed so that the specified point is at the top of the * capital letters * Center: * text is placed so that the specified point is equidistant from the * bottom of descenders and the top of the capital letters * Bottom: * text is placed so that the bottom of descenders is on the specified * point * Base: * text is placed so that the bottom of the characters with no descenders * is on the specified point * Caps_Center: * text is placed so that the specified point is equidistant from the * bottom and tops of capital letters *----------------------------------------------------------------------*/#ifndef _RXVTGRX_H#define _RXVTGRX_H#define GRX_SCALE 10000#define RIGHT_TEXT 0x10#define HCENTER_TEXT 0x20#define LEFT_TEXT 0x30#define HORIZONTAL_ALIGNMENT 0x70#define TOP_TEXT 0x01#define VCENTER_TEXT 0x02#define BOTTOM_TEXT 0x03#define BASE_TEXT 0x04#define VCAPS_CENTER_TEXT 0x05#define VERTICAL_ALIGNMENT 0x0F#if 0 /* this would be nicer */# define TXT_RIGHT 'r'# define TXT_CENTER 'c'# define TXT_LEFT 'l'# define TXT_TOP 't'# define TXT_VCENTER 'v'# define TXT_BOTTOM 'b'# define TXT_BASE '_'# define TXT_VCAPS_CENTER 'C'#endif#endif /* whole file *//*----------------------- end-of-file (C header) -----------------------*//* * $Id: screen.h,v 1.8 1998/11/25 16:34:13 mason Exp $ */#ifndef _SCREEN_H /* include once only */#define _SCREEN_H#if defined(MULTICHAR_SET)#define rend_t unsigned int#else#define rend_t unsigned short#endif/* * screen accounting: * screen_t elements * text: Contains all text information including the scrollback buffer. * Each line is length TermWin.ncol * tlen: The length of the line or -1 for wrapped lines. * rend: Contains rendition information: font, bold, colour, etc. * * Note: Each line for both text and rend are only allocated on demand, and * text[x] is allocated <=> rend[x] is allocated for all x. * row: Cursor row position : 0 <= row < TermWin.nrow * col: Cursor column position : 0 <= col < TermWin.ncol * tscroll: Scrolling region top row inclusive : 0 <= row < TermWin.nrow * bscroll: Scrolling region bottom row inclusive : 0 <= row < TermWin.nrow * * selection_t elements * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where * nothing is selected * beg: row/column of beginning of selection : never past mark * mark: row/column of initial click : never past end * end: row/column of one character past end of selection * * Note: -TermWin.nscrolled <= beg.row <= mark.row <= end.row < TermWin.nrow * * Note: col == -1 ==> we're left of screen * * TermWin.saveLines: * Maximum number of lines in the scrollback buffer. * This is fixed for each rxvt instance. * TermWin.nscrolled: * Actual number of lines we've used of the scrollback buffer * 0 <= TermWin.nscrolled <= TermWin.saveLines * TermWin.view_start: * Offset back into the scrollback buffer for out current view * 0 <= TermWin.view_start <= TermWin.nscrolled * * Layout of text/rend information in the screen_t text/rend structures: * Rows [0] ... [TermWin.saveLines - 1] * scrollback region : we're only here if TermWin.view_start != 0 * Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1] * normal `unscrolled' screen region */struct _screen_t { text_t **text; /* _all_ the text */ short *tlen; /* length of each text line */ rend_t **rend; /* rendition, uses RS_ flags */ row_col_t cur; /* cursor position on the screen */ short tscroll, /* top of settable scroll region */ bscroll, /* bottom of settable scroll region */ charset; /* character set number [0..3] */ unsigned int flags; /* see below */} screen;struct save_t { row_col_t cur; /* cursor position */ short charset; /* character set number [0..3] */ char charset_char; rend_t rstyle; /* rendition style */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -