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.342 by ayin, Sat Dec 29 12:03:39 2007 UTC vs.
Revision 1.362 by ayin, Tue Feb 19 13:01:33 2008 UTC

97/* 97/*
98 ***************************************************************************** 98 *****************************************************************************
99 * SYSTEM HACKS 99 * SYSTEM HACKS
100 ***************************************************************************** 100 *****************************************************************************
101 */ 101 */
102/* Consistent defines - please report on the necessity
103 * @ Unixware: defines (__svr4__)
104 */
105#if defined (SVR4) && !defined (__svr4__)
106# define __svr4__ 1
107#endif
108#if defined (sun) && !defined (__sun__)
109# define __sun__ 1
110#endif
111 102
112#ifndef HAVE_XPOINTER 103#ifndef HAVE_XPOINTER
113typedef char *XPointer; 104typedef char *XPointer;
114#endif 105#endif
115 106
116#include <termios.h> 107#include <termios.h>
117typedef struct termios ttymode_t;
118 108
119#include "background.h" 109#include "background.h"
120 110
121#ifndef STDIN_FILENO 111#ifndef STDIN_FILENO
122# define STDIN_FILENO 0 112# define STDIN_FILENO 0
210 ***************************************************************************** 200 *****************************************************************************
211 * STRUCTURES AND TYPEDEFS 201 * STRUCTURES AND TYPEDEFS
212 ***************************************************************************** 202 *****************************************************************************
213 */ 203 */
214 204
215/* If we're using either the rxvt scrollbar, keep the
216 * scrollColor resource.
217 */
218#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
219# define KEEP_SCROLLCOLOR 1
220#else
221# undef KEEP_SCROLLCOLOR
222#endif
223
224/* 205/*
225 * the 'essential' information for reporting Mouse Events 206 * the 'essential' information for reporting Mouse Events
226 * pared down from XButtonEvent 207 * pared down from XButtonEvent
227 */ 208 */
228struct mouse_event { 209struct mouse_event {
278# define NO_MOUSE_REPORT_SCROLLBAR 1 259# define NO_MOUSE_REPORT_SCROLLBAR 1
279#endif 260#endif
280 261
281#define scrollBar_esc 30 262#define scrollBar_esc 30
282 263
283#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 264#if !defined (RXVT_SCROLLBAR) && !defined (NEXT_SCROLLBAR)
284# define HAVE_SCROLLBARS 1 265# define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1
285#endif 266#endif
286 267
287enum { 268enum {
288 NO_REFRESH = 0, /* Window not visible at all! */ 269 NO_REFRESH = 0, /* Window not visible at all! */
289 FAST_REFRESH = 1, /* Fully exposed window */ 270 FAST_REFRESH = 1, /* Fully exposed window */
395 XTerm_name = 0, 376 XTerm_name = 0,
396 XTerm_iconName = 1, 377 XTerm_iconName = 1,
397 XTerm_title = 2, 378 XTerm_title = 2,
398 XTerm_property = 3, // change X property 379 XTerm_property = 3, // change X property
399 XTerm_Color = 4, // change colors 380 XTerm_Color = 4, // change colors
400 XTerm_Color00 = 10, // not implemented, CLASH! 381 XTerm_Color00 = 10, // change fg color
401 XTerm_Color01 = 11, // not implemented 382 XTerm_Color01 = 11, // change bg color
402 XTerm_Color_cursor = 12, // change actual 'Cursor' color 383 XTerm_Color_cursor = 12, // change actual 'Cursor' color
403 XTerm_Color_pointer_fg = 13, // change actual 'Pointer' fg color 384 XTerm_Color_pointer_fg = 13, // change actual 'Pointer' fg color
404 XTerm_Color_pointer_bg = 14, // change actual 'Pointer' bg color 385 XTerm_Color_pointer_bg = 14, // change actual 'Pointer' bg color
405 XTerm_Color05 = 15, // not implemented (tektronix fg) 386 XTerm_Color05 = 15, // not implemented (tektronix fg)
406 XTerm_Color06 = 16, // not implemented (tektronix bg) 387 XTerm_Color06 = 16, // not implemented (tektronix bg)
411 XTerm_konsole30 = 30, // reserved for konsole 392 XTerm_konsole30 = 30, // reserved for konsole
412 XTerm_konsole31 = 31, // reserved for konsole 393 XTerm_konsole31 = 31, // reserved for konsole
413 XTerm_emacs51 = 51, // reserved for emacs shell 394 XTerm_emacs51 = 51, // reserved for emacs shell
414 /* 395 /*
415 * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) 396 * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL)
416 * at least Rxvt_Color_BD and Rxvt_Color_UL clash with xterm
417 */ 397 */
418 Rxvt_Color_BD = 18, // change actual 'Bold' color 398
419 Rxvt_Color_UL = 19, // change actual 'Underline' color 399 // deprecated
400 Rxvt_Color_BD = 18,
401 Rxvt_Color_UL = 19,
402 Rxvt_restoreFG = 39,
403 Rxvt_restoreBG = 49,
404
420 Rxvt_Pixmap = 20, // new bg pixmap 405 Rxvt_Pixmap = 20, // new bg pixmap
421 Rxvt_restoreFG = 39, // change default fg color
422 Rxvt_restoreBG = 49, // change default bg color
423 Rxvt_dumpscreen = 55, // dump scrollback and all of screen 406 Rxvt_dumpscreen = 55, // dump scrollback and all of screen
424 407
425 URxvt_locale = 701, // change locale 408 URxvt_locale = 701, // change locale
426 URxvt_version = 702, // request version 409 URxvt_version = 702, // request version
427 410
428 URxvt_Color_IT = 704, // change actual 'Italic' colour 411 URxvt_Color_IT = 704, // change actual 'Italic' colour
429 URxvt_Color_tint = 705, // change actual tint colour 412 URxvt_Color_tint = 705, // change actual tint colour
430 URxvt_Color_BD = 706, 413 URxvt_Color_BD = 706, // change actual 'Bold' color
431 URxvt_Color_UL = 707, 414 URxvt_Color_UL = 707, // change actual 'Underline' color
432 415
433 URxvt_font = 710, 416 URxvt_font = 710,
434 URxvt_boldFont = 711, 417 URxvt_boldFont = 711,
435 URxvt_italicFont = 712, 418 URxvt_italicFont = 712,
436 URxvt_boldItalicFont = 713, 419 URxvt_boldItalicFont = 713,
496 Color_underline, 479 Color_underline,
497#endif 480#endif
498#ifdef OPTION_HC 481#ifdef OPTION_HC
499 Color_HC, 482 Color_HC,
500#endif 483#endif
501#ifdef KEEP_SCROLLCOLOR
502 Color_scroll, 484 Color_scroll,
485#ifdef RXVT_SCROLLBAR
503 Color_trough, 486 Color_trough,
504#endif 487#endif
505#if ENABLE_TRANSPARENCY 488#if ENABLE_TRANSPARENCY
506 Color_tint, 489 Color_tint,
507#endif 490#endif
508#if OFF_FOCUS_FADING 491#if OFF_FOCUS_FADING
509 Color_fade, 492 Color_fade,
510#endif 493#endif
511 NRS_COLORS, /* */ 494 NRS_COLORS, /* */
512#ifdef KEEP_SCROLLCOLOR 495#ifdef RXVT_SCROLLBAR
513 Color_topShadow = NRS_COLORS, 496 Color_topShadow = NRS_COLORS,
514 Color_bottomShadow, 497 Color_bottomShadow,
515 TOTAL_COLORS 498 TOTAL_COLORS
516#else 499#else
517 TOTAL_COLORS = NRS_COLORS 500 TOTAL_COLORS = NRS_COLORS
553#define PrivMode_smoothScroll (1UL<<17) 536#define PrivMode_smoothScroll (1UL<<17)
554#define PrivMode_vt52 (1UL<<18) 537#define PrivMode_vt52 (1UL<<18)
555#define PrivMode_LFNL (1UL<<19) 538#define PrivMode_LFNL (1UL<<19)
556#define PrivMode_MouseBtnEvent (1UL<<20) 539#define PrivMode_MouseBtnEvent (1UL<<20)
557#define PrivMode_MouseAnyEvent (1UL<<21) 540#define PrivMode_MouseAnyEvent (1UL<<21)
541#define PrivMode_BracketPaste (1UL<<22)
558 542
559#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) 543#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent)
560 544
561#ifdef ALLOW_132_MODE 545#ifdef ALLOW_132_MODE
562# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 546# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
658 642
659#if ENABLE_STYLES 643#if ENABLE_STYLES
660# define FONTSET(style) fontset[GET_STYLE (style)] 644# define FONTSET(style) fontset[GET_STYLE (style)]
661#else 645#else
662# define FONTSET(style) fontset[0] 646# define FONTSET(style) fontset[0]
663#endif
664
665#ifdef HAVE_SCROLLBARS
666# define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2)
667#else
668# define scrollbar_TotalWidth() (0)
669#endif 647#endif
670 648
671typedef callback<void (const char *)> log_callback; 649typedef callback<void (const char *)> log_callback;
672typedef callback<int (int)> getfd_callback; 650typedef callback<int (int)> getfd_callback;
673 651
933 scrollBar_t scrollBar; 911 scrollBar_t scrollBar;
934 uint8_t options[(Opt_count + 7) >> 3]; 912 uint8_t options[(Opt_count + 7) >> 3];
935 XSizeHints szHint; 913 XSizeHints szHint;
936 rxvt_color *pix_colors; 914 rxvt_color *pix_colors;
937 Cursor TermWin_cursor; /* cursor for vt window */ 915 Cursor TermWin_cursor; /* cursor for vt window */
938 int sb_shadow; /* scrollbar shadow width */
939 int numlock_state; 916 int numlock_state;
940 line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf 917 line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf
941 line_t *drawn_buf; // text on screen 918 line_t *drawn_buf; // text on screen
942 line_t *swap_buf; // lines for swap buffer 919 line_t *swap_buf; // lines for swap buffer
943 char *tabs; /* per location: 1 == tab-stop */ 920 char *tabs; /* per location: 1 == tab-stop */
984 961
985 unsigned char refresh_type, 962 unsigned char refresh_type,
986#ifdef META8_OPTION 963#ifdef META8_OPTION
987 meta_char, /* Alt-key prefix */ 964 meta_char, /* Alt-key prefix */
988#endif 965#endif
989 scrollbar_align,
990 selection_wait, 966 selection_wait,
991 selection_type; 967 selection_type;
992/* ---------- */ 968/* ---------- */
993 bool rvideo_state, rvideo_mode; 969 bool rvideo_state, rvideo_mode;
994#ifndef NO_BELL 970#ifndef NO_BELL
1012 /* give proper Scroll behaviour */ 988 /* give proper Scroll behaviour */
1013#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 989#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1014 mouse_slip_wheel_speed, 990 mouse_slip_wheel_speed,
1015#endif 991#endif
1016 refresh_count, 992 refresh_count,
1017 last_bot, /* scrollbar last bottom position */
1018 last_top, /* scrollbar last top position */
1019 last_state, /* scrollbar last state */
1020 scrollbar_len,
1021 window_vt_x, 993 window_vt_x,
1022 window_vt_y, 994 window_vt_y,
1023 window_sb_x,
1024 mouse_row, 995 mouse_row,
1025 mouse_col, 996 mouse_col,
1026# ifdef POINTER_BLANK 997# ifdef POINTER_BLANK
1027 pointerBlankDelay, 998 pointerBlankDelay,
1028# endif 999# endif
1036 unsigned long priv_modes, 1007 unsigned long priv_modes,
1037 SavedModes; 1008 SavedModes;
1038/* ---------- */ 1009/* ---------- */
1039 Atom *xa; 1010 Atom *xa;
1040/* ---------- */ 1011/* ---------- */
1041#ifdef RXVT_SCROLLBAR
1042 GC scrollbarGC,
1043 topShadowGC,
1044 botShadowGC;
1045#endif
1046#ifdef XTERM_SCROLLBAR
1047 GC xscrollbarGC,
1048 ShadowGC;
1049#endif
1050#ifdef PLAIN_SCROLLBAR
1051 GC pscrollbarGC;
1052#endif
1053#ifdef NEXT_SCROLLBAR
1054 GC blackGC,
1055 whiteGC,
1056 grayGC,
1057 darkGC,
1058 stippleGC;
1059 Pixmap dimple,
1060 upArrow,
1061 downArrow,
1062 upArrowHi,
1063 downArrowHi;
1064#endif
1065/* ---------- */
1066 Time selection_time, 1012 Time selection_time,
1067 selection_request_time; 1013 selection_request_time;
1068 pid_t cmd_pid; /* process id of child */ 1014 pid_t cmd_pid; /* process id of child */
1069 char * incr_buf; 1015 char * incr_buf;
1070 size_t incr_buf_size, incr_buf_fill; 1016 size_t incr_buf_size, incr_buf_fill;
1071/* ---------- */ 1017/* ---------- */
1072 Cursor leftptr_cursor;
1073/* ---------- */
1074 struct mouse_event MEvent; 1018 struct mouse_event MEvent;
1075 XComposeStatus compose; 1019 XComposeStatus compose;
1076 ttymode_t tio; 1020 struct termios tio;
1077 row_col_t oldcursor; 1021 row_col_t oldcursor;
1078#ifdef HAVE_BG_PIXMAP 1022#ifdef HAVE_BG_PIXMAP
1079 bgPixmap_t bgPixmap; 1023 bgPixmap_t bgPixmap;
1080#endif 1024#endif
1081#ifdef HAVE_AFTERIMAGE 1025#ifdef HAVE_AFTERIMAGE
1132 1076
1133#if ENABLE_FRILLS || ISO_14755 1077#if ENABLE_FRILLS || ISO_14755
1134 // ISO 14755 entry support 1078 // ISO 14755 entry support
1135 unicode_t iso14755buf; 1079 unicode_t iso14755buf;
1136 void commit_iso14755 (); 1080 void commit_iso14755 ();
1137 int hex_keyval (XKeyEvent &ev);
1138# if ISO_14755 1081# if ISO_14755
1139 void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE, int x = 0, int y = -1); 1082 void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE, int x = 0, int y = -1);
1140 void iso14755_54 (int x, int y); 1083 void iso14755_54 (int x, int y);
1141# endif 1084# endif
1142#endif 1085#endif
1163#endif 1106#endif
1164 1107
1165 void x_cb (XEvent &xev); 1108 void x_cb (XEvent &xev);
1166 xevent_watcher termwin_ev; 1109 xevent_watcher termwin_ev;
1167 xevent_watcher vt_ev; 1110 xevent_watcher vt_ev;
1168#ifdef HAVE_SCROLLBARS
1169 xevent_watcher scrollbar_ev; 1111 xevent_watcher scrollbar_ev;
1170#endif
1171 1112
1172 void child_cb (ev::child &w, int revents); ev::child child_ev; 1113 void child_cb (ev::child &w, int revents); ev::child child_ev;
1173 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; 1114 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev;
1174 void refresh_check (); 1115 void refresh_check ();
1175 void flush (); 1116 void flush ();
1276 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); 1217 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg);
1277 void process_sgr_mode (unsigned int nargs, const int *arg); 1218 void process_sgr_mode (unsigned int nargs, const int *arg);
1278 void process_graphics (); 1219 void process_graphics ();
1279 // init.C 1220 // init.C
1280 void init_vars (); 1221 void init_vars ();
1281 void init_secondary ();
1282 const char **init_resources (int argc, const char *const *argv); 1222 const char **init_resources (int argc, const char *const *argv);
1223 void init (int argc, const char *const *argv, stringvec *envv);
1283 void init_env (); 1224 void init_env ();
1284 void set_locale (const char *locale); 1225 void set_locale (const char *locale);
1285 void init_xlocale (); 1226 void init_xlocale ();
1286 void init_command (const char *const *argv); 1227 void init_command (const char *const *argv);
1287 void run_command (const char *const *argv); 1228 void run_command (const char *const *argv);
1294 void tt_winch (); 1235 void tt_winch ();
1295 rxvt_term (); 1236 rxvt_term ();
1296 ~rxvt_term (); 1237 ~rxvt_term ();
1297 void destroy (); 1238 void destroy ();
1298 void emergency_cleanup (); 1239 void emergency_cleanup ();
1299 void init (int argc, const char *const *argv, stringvec *envv);
1300 void recolour_cursor (); 1240 void recolour_cursor ();
1301 void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent); 1241 void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent);
1302 void window_calc (unsigned int newwidth, unsigned int newheight); 1242 void window_calc (unsigned int newwidth, unsigned int newheight);
1303 bool set_fonts (); 1243 bool set_fonts ();
1304 void set_string_property (Atom prop, const char *str, int len = -1); 1244 void set_string_property (Atom prop, const char *str, int len = -1);
1390 options[opt >> 3] |= (1 << (opt & 7)); 1330 options[opt >> 3] |= (1 << (opt & 7));
1391 else 1331 else
1392 options[opt >> 3] &= ~(1 << (opt & 7)); 1332 options[opt >> 3] &= ~(1 << (opt & 7));
1393 } 1333 }
1394 1334
1395 void PrivMode (int set, unsigned bit) NOTHROW 1335 void set_privmode (unsigned bit, int set) NOTHROW
1396 { 1336 {
1397 if (set) 1337 if (set)
1398 priv_modes |= bit; 1338 priv_modes |= bit;
1399 else 1339 else
1400 priv_modes &= ~bit; 1340 priv_modes &= ~bit;
1476 void selection_send (const XSelectionRequestEvent &rq) NOTHROW; 1416 void selection_send (const XSelectionRequestEvent &rq) NOTHROW;
1477 void selection_click (int clicks, int x, int y) NOTHROW; 1417 void selection_click (int clicks, int x, int y) NOTHROW;
1478 void selection_extend (int x, int y, int flag) NOTHROW; 1418 void selection_extend (int x, int y, int flag) NOTHROW;
1479 void selection_rotate (int x, int y) NOTHROW; 1419 void selection_rotate (int x, int y) NOTHROW;
1480 1420
1481#if defined(NEXT_SCROLLBAR)
1482 // scrollbar-next.C
1483 Pixmap renderPixmap (const char *const *data, int width, int height);
1484 void init_scrollbar_stuff ();
1485 void drawBevel (Drawable d, int x1, int y1, int w, int h);
1486 int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len);
1487#endif
1488
1489#if defined(RXVT_SCROLLBAR)
1490 // scrollbar-rxvt.C
1491 int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len);
1492#endif
1493
1494#if defined(XTERM_SCROLLBAR)
1495 // scrollbar-xterm.C
1496 int scrollbar_show_xterm (int update, int last_top, int last_bot, int scrollbar_len);
1497#endif
1498
1499#if defined(PLAIN_SCROLLBAR)
1500 // scrollbar-plain.C
1501 int scrollbar_show_plain (int update, int last_top, int last_bot, int scrollbar_len);
1502#endif
1503
1504 // scrollbar.C
1505 void resize_scrollbar ();
1506 int scrollbar_mapping (int map);
1507 int scrollbar_show (int update);
1508 void setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness);
1509
1510 // xdefaults.C 1421 // xdefaults.C
1511 void get_options (int argc, const char *const *argv); 1422 void get_options (int argc, const char *const *argv);
1512 int parse_keysym (const char *str, const char *arg); 1423 int parse_keysym (const char *str, const char *arg);
1513 const char *x_resource (const char *name); 1424 const char *x_resource (const char *name);
1514 void extract_resources (); 1425 void extract_resources ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines