ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.262 by root, Sat Aug 26 06:37:10 2006 UTC vs.
Revision 1.275 by root, Tue Jun 26 00:40:19 2007 UTC

70 70
71#ifndef HAVE_XPOINTER 71#ifndef HAVE_XPOINTER
72typedef char *XPointer; 72typedef char *XPointer;
73#endif 73#endif
74 74
75#ifdef HAVE_TERMIOS_H
76# include <termios.h> 75#include <termios.h>
77typedef struct termios ttymode_t; 76typedef struct termios ttymode_t;
78#else
79# include <sgtty.h>
80typedef struct {
81 struct sgttyb sg;
82 struct tchars tc;
83 struct ltchars lc;
84 int line;
85 int local;
86} ttymode_t;
87#endif
88 77
78#ifdef HAVE_AFTERIMAGE
79# include <afterimage.h>
80#undef min
81#undef max
89#ifdef XPM_BACKGROUND 82#elif defined(XPM_BACKGROUND)
90# ifdef XPM_INC_X11 83# ifdef XPM_INC_X11
91# include <X11/xpm.h> 84# include <X11/xpm.h>
92# else 85# else
93# include <xpm.h> 86# include <xpm.h>
94# endif 87# endif
188#endif 181#endif
189 182
190#ifdef XPM_BACKGROUND 183#ifdef XPM_BACKGROUND
191typedef struct { 184typedef struct {
192 short w, h, x, y; 185 short w, h, x, y;
186 bool auto_resize ;
193 Pixmap pixmap; 187 Pixmap pixmap;
194} bgPixmap_t; 188} bgPixmap_t;
195#endif 189#endif
196 190
197/* 191/*
520 * on the unnecessary items, e.g. Color_pointer, but won't bother 514 * on the unnecessary items, e.g. Color_pointer, but won't bother
521 * until we need to. Also, be aware of usage in pixcolor_set 515 * until we need to. Also, be aware of usage in pixcolor_set
522 */ 516 */
523 517
524enum colour_list { 518enum colour_list {
519 Color_none = -2,
520 Color_transparent = -1,
525 Color_fg = 0, 521 Color_fg = 0,
526 Color_bg, 522 Color_bg,
527 minCOLOR, /* 2 */ 523 minCOLOR, /* 2 */
528 Color_Black = minCOLOR, 524 Color_Black = minCOLOR,
529 Color_Red3, 525 Color_Red3,
682 * MACRO DEFINES 678 * MACRO DEFINES
683 ***************************************************************************** 679 *****************************************************************************
684 */ 680 */
685#define dLocal(type,name) type const name = this->name 681#define dLocal(type,name) type const name = this->name
686 682
687// for speed reasons, we assume that all latin1 characters 683// for speed reasons, we assume that all codepoints 32 to 126 are
688// are single-width (the first unicode combining character 684// single-width.
689// is actually 0x300, but ascii is what matters most). 685#define WCWIDTH(c) (IN_RANGE_INC (c, 0x20, 0x7e) ? 1 : wcwidth (c))
690#define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1)
691 686
692/* convert pixel dimensions to row/column values. Everything as int32_t */ 687/* convert pixel dimensions to row/column values. Everything as int32_t */
693#define Pixel2Col(x) Pixel2Width((int32_t)(x)) 688#define Pixel2Col(x) Pixel2Width((int32_t)(x))
694#define Pixel2Row(y) Pixel2Height((int32_t)(y)) 689#define Pixel2Row(y) Pixel2Height((int32_t)(y))
695#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) 690#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth)
696#define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight) 691#define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight)
697#define Col2Pixel(col) ((int32_t)Width2Pixel(col)) 692#define Col2Pixel(col) ((int32_t)Width2Pixel(col))
698#define Row2Pixel(row) ((int32_t)Height2Pixel(row)) 693#define Row2Pixel(row) ((int32_t)Height2Pixel(row))
699#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) 694#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth)
700#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) 695#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight)
701
702#define OPTION(opt) (options & (opt))
703#define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \
704 | Opt_jumpScroll | Opt_secondaryScreen \
705 | Opt_pastableTabs | Opt_intensityStyles)
706 696
707// for m >= -n, ensure remainder lies between 0..n-1 697// for m >= -n, ensure remainder lies between 0..n-1
708#define MOD(m,n) (((m) + (n)) % (n)) 698#define MOD(m,n) (((m) + (n)) % (n))
709 699
710#define LINENO(n) MOD (term_start + int(n), total_rows) 700#define LINENO(n) MOD (term_start + int(n), total_rows)
909 rxvt_perl_term perl; 899 rxvt_perl_term perl;
910#endif 900#endif
911 struct mbstate mbstate; // current input multibyte state 901 struct mbstate mbstate; // current input multibyte state
912 902
913 unsigned char want_refresh:1, 903 unsigned char want_refresh:1,
914#ifdef TRANSPARENT 904#ifdef ENABLE_TRANSPARENCY
915 want_full_refresh:1, /* awaiting full screen refresh */ 905 want_full_refresh:1, /* awaiting full screen refresh */
916#endif
917#if defined(XPM_BACKGROUND) || defined(TRANSPARENT)
918 am_transparent:1, /* is a transparent term */ 906 am_transparent:1, /* is a transparent term */
919 am_pixmap_trans:1, /* transparency w/known root pixmap */ 907 am_pixmap_trans:1, /* transparency w/known root pixmap */
920#endif 908#endif
921 current_screen:1, /* primary or secondary */ 909 current_screen:1, /* primary or secondary */
922 num_scr_allow:1, 910 num_scr_allow:1,
965 /* give proper Scroll behaviour */ 953 /* give proper Scroll behaviour */
966#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 954#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
967 mouse_slip_wheel_speed, 955 mouse_slip_wheel_speed,
968#endif 956#endif
969 refresh_count, 957 refresh_count,
970 refresh_limit,
971 last_bot, /* scrollbar last bottom position */ 958 last_bot, /* scrollbar last bottom position */
972 last_top, /* scrollbar last top position */ 959 last_top, /* scrollbar last top position */
973 last_state, /* scrollbar last state */ 960 last_state, /* scrollbar last state */
974 scrollbar_len, 961 scrollbar_len,
975 window_vt_x, 962 window_vt_x,
1033 XComposeStatus compose; 1020 XComposeStatus compose;
1034 ttymode_t tio; 1021 ttymode_t tio;
1035 row_col_t oldcursor; 1022 row_col_t oldcursor;
1036#ifdef XPM_BACKGROUND 1023#ifdef XPM_BACKGROUND
1037 bgPixmap_t bgPixmap; 1024 bgPixmap_t bgPixmap;
1025#ifdef HAVE_AFTERIMAGE
1026 ASImageManager *asimman;
1027 ASImage *original_asim;
1028 struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */
1029#else
1038 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ 1030 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */
1031#endif
1039#endif 1032#endif
1040 1033
1041#if ENABLE_OVERLAY 1034#if ENABLE_OVERLAY
1042 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions 1035 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions
1043 text_t **ov_text; 1036 text_t **ov_text;
1101 void vt_select_input () const NOTHROW 1094 void vt_select_input () const NOTHROW
1102 { 1095 {
1103 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); 1096 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim);
1104 } 1097 }
1105 1098
1106#if TRANSPARENT || ENABLE_PERL 1099#if ENABLE_TRANSPARENCY || ENABLE_PERL
1107 void rootwin_cb (XEvent &xev); 1100 void rootwin_cb (XEvent &xev);
1108 xevent_watcher rootwin_ev; 1101 xevent_watcher rootwin_ev;
1102#endif
1103#if ENABLE_TRANSPARENCY
1104 int check_our_parents ();
1105 void check_our_parents_cb (time_watcher &w);
1106 time_watcher check_our_parents_ev;
1109#endif 1107#endif
1110 1108
1111 void x_cb (XEvent &xev); 1109 void x_cb (XEvent &xev);
1112 void flush (); 1110 void flush ();
1113 xevent_watcher termwin_ev; 1111 xevent_watcher termwin_ev;
1231 void button_press (XButtonEvent &ev); 1229 void button_press (XButtonEvent &ev);
1232 void button_release (XButtonEvent &ev); 1230 void button_release (XButtonEvent &ev);
1233 void focus_in (); 1231 void focus_in ();
1234 void focus_out (); 1232 void focus_out ();
1235 void update_fade_color (unsigned int idx); 1233 void update_fade_color (unsigned int idx);
1236 int check_our_parents ();
1237#ifdef PRINTPIPE 1234#ifdef PRINTPIPE
1238 FILE *popen_printer (); 1235 FILE *popen_printer ();
1239 int pclose_printer (FILE *stream); 1236 int pclose_printer (FILE *stream);
1240#endif 1237#endif
1241 void process_print_pipe (); 1238 void process_print_pipe ();
1302 { 1299 {
1303 int base = GET_BASEFG (r); 1300 int base = GET_BASEFG (r);
1304#ifndef NO_BRIGHTCOLOR 1301#ifndef NO_BRIGHTCOLOR
1305 if (r & RS_Bold 1302 if (r & RS_Bold
1306# if ENABLE_STYLES 1303# if ENABLE_STYLES
1307 && OPTION (Opt_intensityStyles) 1304 && option (Opt_intensityStyles)
1308# endif 1305# endif
1309 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1306 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
1310 base += minBrightCOLOR - minCOLOR; 1307 base += minBrightCOLOR - minCOLOR;
1311#endif 1308#endif
1312 return base; 1309 return base;
1316 { 1313 {
1317 int base = GET_BASEBG (r); 1314 int base = GET_BASEBG (r);
1318#ifndef NO_BRIGHTCOLOR 1315#ifndef NO_BRIGHTCOLOR
1319 if (r & RS_Blink 1316 if (r & RS_Blink
1320# if ENABLE_STYLES 1317# if ENABLE_STYLES
1321 && OPTION (Opt_intensityStyles) 1318 && option (Opt_intensityStyles)
1322# endif 1319# endif
1323 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1320 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
1324 base += minBrightCOLOR - minCOLOR; 1321 base += minBrightCOLOR - minCOLOR;
1325#endif 1322#endif
1326 return base; 1323 return base;
1327 } 1324 }
1328 1325
1329 bool option (uint32_t opt) const NOTHROW 1326 bool option (uint8_t opt) const NOTHROW
1330 { 1327 {
1331 return OPTION (opt); 1328 return options[opt >> 3] & (1 << (opt & 7));
1332 } 1329 }
1333 1330
1334 void set_option (uint32_t opt, bool set) NOTHROW 1331 void set_option (uint8_t opt, bool set = true) NOTHROW
1335 { 1332 {
1336 if (set) 1333 if (set)
1337 options |= opt; 1334 options[opt >> 3] |= (1 << (opt & 7));
1338 else 1335 else
1339 options &= ~opt; 1336 options[opt >> 3] &= ~(1 << (opt & 7));
1340 } 1337 }
1341 1338
1342 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1339 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
1343 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; 1340 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW;
1344 int scr_scroll_text (int row1, int row2, int count) NOTHROW; 1341 int scr_scroll_text (int row1, int row2, int count) NOTHROW;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines