… | |
… | |
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 |
113 | typedef char *XPointer; |
104 | typedef char *XPointer; |
114 | #endif |
105 | #endif |
115 | |
106 | |
… | |
… | |
209 | ***************************************************************************** |
200 | ***************************************************************************** |
210 | * STRUCTURES AND TYPEDEFS |
201 | * STRUCTURES AND TYPEDEFS |
211 | ***************************************************************************** |
202 | ***************************************************************************** |
212 | */ |
203 | */ |
213 | |
204 | |
214 | /* If we're using either the rxvt scrollbar, keep the |
|
|
215 | * scrollColor resource. |
|
|
216 | */ |
|
|
217 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
|
|
218 | # define KEEP_SCROLLCOLOR 1 |
|
|
219 | #else |
|
|
220 | # undef KEEP_SCROLLCOLOR |
|
|
221 | #endif |
|
|
222 | |
|
|
223 | /* |
205 | /* |
224 | * the 'essential' information for reporting Mouse Events |
206 | * the 'essential' information for reporting Mouse Events |
225 | * pared down from XButtonEvent |
207 | * pared down from XButtonEvent |
226 | */ |
208 | */ |
227 | struct mouse_event { |
209 | struct mouse_event { |
… | |
… | |
277 | # define NO_MOUSE_REPORT_SCROLLBAR 1 |
259 | # define NO_MOUSE_REPORT_SCROLLBAR 1 |
278 | #endif |
260 | #endif |
279 | |
261 | |
280 | #define scrollBar_esc 30 |
262 | #define scrollBar_esc 30 |
281 | |
263 | |
282 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
264 | #if !defined (RXVT_SCROLLBAR) && !defined (NEXT_SCROLLBAR) |
283 | # define HAVE_SCROLLBARS 1 |
265 | # define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1 |
284 | #endif |
266 | #endif |
285 | |
267 | |
286 | enum { |
268 | enum { |
287 | NO_REFRESH = 0, /* Window not visible at all! */ |
269 | NO_REFRESH = 0, /* Window not visible at all! */ |
288 | FAST_REFRESH = 1, /* Fully exposed window */ |
270 | FAST_REFRESH = 1, /* Fully exposed window */ |
… | |
… | |
437 | URxvt_boldItalicFont = 713, |
419 | URxvt_boldItalicFont = 713, |
438 | |
420 | |
439 | URxvt_view_up = 720, |
421 | URxvt_view_up = 720, |
440 | URxvt_view_down = 721, |
422 | URxvt_view_down = 721, |
441 | |
423 | |
442 | URxvt_perl = 777, |
424 | URxvt_perl = 777, // for use by perl extensions, starts with "extension-name;" |
443 | }; |
425 | }; |
444 | |
426 | |
445 | /* Words starting with `Color_' are colours. Others are counts */ |
427 | /* Words starting with `Color_' are colours. Others are counts */ |
446 | /* |
428 | /* |
447 | * The PixColor and rendition colour usage should probably be decoupled |
429 | * The PixColor and rendition colour usage should probably be decoupled |
… | |
… | |
497 | Color_underline, |
479 | Color_underline, |
498 | #endif |
480 | #endif |
499 | #ifdef OPTION_HC |
481 | #ifdef OPTION_HC |
500 | Color_HC, |
482 | Color_HC, |
501 | #endif |
483 | #endif |
502 | #ifdef KEEP_SCROLLCOLOR |
|
|
503 | Color_scroll, |
484 | Color_scroll, |
|
|
485 | #ifdef RXVT_SCROLLBAR |
504 | Color_trough, |
486 | Color_trough, |
505 | #endif |
487 | #endif |
506 | #if ENABLE_TRANSPARENCY |
488 | #if ENABLE_TRANSPARENCY |
507 | Color_tint, |
489 | Color_tint, |
508 | #endif |
490 | #endif |
509 | #if OFF_FOCUS_FADING |
491 | #if OFF_FOCUS_FADING |
510 | Color_fade, |
492 | Color_fade, |
511 | #endif |
493 | #endif |
512 | NRS_COLORS, /* */ |
494 | NRS_COLORS, /* */ |
513 | #ifdef KEEP_SCROLLCOLOR |
495 | #ifdef RXVT_SCROLLBAR |
514 | Color_topShadow = NRS_COLORS, |
496 | Color_topShadow = NRS_COLORS, |
515 | Color_bottomShadow, |
497 | Color_bottomShadow, |
516 | TOTAL_COLORS |
498 | TOTAL_COLORS |
517 | #else |
499 | #else |
518 | TOTAL_COLORS = NRS_COLORS |
500 | TOTAL_COLORS = NRS_COLORS |
… | |
… | |
554 | #define PrivMode_smoothScroll (1UL<<17) |
536 | #define PrivMode_smoothScroll (1UL<<17) |
555 | #define PrivMode_vt52 (1UL<<18) |
537 | #define PrivMode_vt52 (1UL<<18) |
556 | #define PrivMode_LFNL (1UL<<19) |
538 | #define PrivMode_LFNL (1UL<<19) |
557 | #define PrivMode_MouseBtnEvent (1UL<<20) |
539 | #define PrivMode_MouseBtnEvent (1UL<<20) |
558 | #define PrivMode_MouseAnyEvent (1UL<<21) |
540 | #define PrivMode_MouseAnyEvent (1UL<<21) |
|
|
541 | #define PrivMode_BracketPaste (1UL<<22) |
559 | |
542 | |
560 | #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) |
561 | |
544 | |
562 | #ifdef ALLOW_132_MODE |
545 | #ifdef ALLOW_132_MODE |
563 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
546 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
… | |
… | |
818 | * +------------+·display·+·= term_start |
801 | * +------------+·display·+·= term_start |
819 | * | terminal | display | |
802 | * | terminal | display | |
820 | * | terminal +---------+ |
803 | * | terminal +---------+ |
821 | * | terminal | |
804 | * | terminal | |
822 | * | terminal | |
805 | * | terminal | |
823 | * +------------+···········= term_stat + nrow - 1 |
806 | * +------------+···········= term_start + nrow - 1 |
824 | * | |
807 | * | |
825 | * | |
808 | * | |
826 | * END······················= total_rows |
809 | * END······················= total_rows |
827 | */ |
810 | */ |
828 | |
811 | |
… | |
… | |
864 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
847 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
865 | * nothing is selected |
848 | * nothing is selected |
866 | * beg: row/column of beginning of selection : never past mark |
849 | * beg: row/column of beginning of selection : never past mark |
867 | * mark: row/column of initial click : never past end |
850 | * mark: row/column of initial click : never past end |
868 | * end: row/column of one character past end of selection |
851 | * end: row/column of one character past end of selection |
869 | * * Note: -nsaved <= beg.row <= mark.row <= end.row < nrow |
852 | * * Note: top_row <= beg.row <= mark.row <= end.row < nrow |
870 | * * Note: col == -1 ==> we're left of screen |
853 | * * Note: col == -1 ==> we're left of screen |
871 | * |
854 | * |
872 | */ |
855 | */ |
873 | typedef struct { |
856 | typedef struct { |
874 | row_col_t cur; /* cursor position on the screen */ |
857 | row_col_t cur; /* cursor position on the screen */ |
… | |
… | |
1007 | mouse_slip_wheel_speed, |
990 | mouse_slip_wheel_speed, |
1008 | #endif |
991 | #endif |
1009 | refresh_count, |
992 | refresh_count, |
1010 | window_vt_x, |
993 | window_vt_x, |
1011 | window_vt_y, |
994 | window_vt_y, |
1012 | window_sb_x, |
|
|
1013 | mouse_row, |
995 | mouse_row, |
1014 | mouse_col, |
996 | mouse_col, |
1015 | # ifdef POINTER_BLANK |
997 | # ifdef POINTER_BLANK |
1016 | pointerBlankDelay, |
998 | pointerBlankDelay, |
1017 | # endif |
999 | # endif |
… | |
… | |
1025 | unsigned long priv_modes, |
1007 | unsigned long priv_modes, |
1026 | SavedModes; |
1008 | SavedModes; |
1027 | /* ---------- */ |
1009 | /* ---------- */ |
1028 | Atom *xa; |
1010 | Atom *xa; |
1029 | /* ---------- */ |
1011 | /* ---------- */ |
1030 | #ifdef RXVT_SCROLLBAR |
|
|
1031 | GC scrollbarGC, |
|
|
1032 | topShadowGC, |
|
|
1033 | botShadowGC; |
|
|
1034 | #endif |
|
|
1035 | #ifdef XTERM_SCROLLBAR |
|
|
1036 | GC xscrollbarGC, |
|
|
1037 | ShadowGC; |
|
|
1038 | #endif |
|
|
1039 | #ifdef PLAIN_SCROLLBAR |
|
|
1040 | GC pscrollbarGC; |
|
|
1041 | #endif |
|
|
1042 | #ifdef NEXT_SCROLLBAR |
|
|
1043 | GC blackGC, |
|
|
1044 | whiteGC, |
|
|
1045 | grayGC, |
|
|
1046 | darkGC, |
|
|
1047 | stippleGC; |
|
|
1048 | Pixmap dimple, |
|
|
1049 | upArrow, |
|
|
1050 | downArrow, |
|
|
1051 | upArrowHi, |
|
|
1052 | downArrowHi; |
|
|
1053 | #endif |
|
|
1054 | /* ---------- */ |
|
|
1055 | Time selection_time, |
1012 | Time selection_time, |
1056 | selection_request_time; |
1013 | selection_request_time; |
1057 | pid_t cmd_pid; /* process id of child */ |
1014 | pid_t cmd_pid; /* process id of child */ |
1058 | char * incr_buf; |
1015 | char * incr_buf; |
1059 | size_t incr_buf_size, incr_buf_fill; |
1016 | size_t incr_buf_size, incr_buf_fill; |
… | |
… | |
1119 | |
1076 | |
1120 | #if ENABLE_FRILLS || ISO_14755 |
1077 | #if ENABLE_FRILLS || ISO_14755 |
1121 | // ISO 14755 entry support |
1078 | // ISO 14755 entry support |
1122 | unicode_t iso14755buf; |
1079 | unicode_t iso14755buf; |
1123 | void commit_iso14755 (); |
1080 | void commit_iso14755 (); |
1124 | int hex_keyval (XKeyEvent &ev); |
|
|
1125 | # if ISO_14755 |
1081 | # if ISO_14755 |
1126 | 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); |
1127 | void iso14755_54 (int x, int y); |
1083 | void iso14755_54 (int x, int y); |
1128 | # endif |
1084 | # endif |
1129 | #endif |
1085 | #endif |
… | |
… | |
1150 | #endif |
1106 | #endif |
1151 | |
1107 | |
1152 | void x_cb (XEvent &xev); |
1108 | void x_cb (XEvent &xev); |
1153 | xevent_watcher termwin_ev; |
1109 | xevent_watcher termwin_ev; |
1154 | xevent_watcher vt_ev; |
1110 | xevent_watcher vt_ev; |
1155 | #ifdef HAVE_SCROLLBARS |
|
|
1156 | xevent_watcher scrollbar_ev; |
1111 | xevent_watcher scrollbar_ev; |
1157 | #endif |
|
|
1158 | |
1112 | |
1159 | 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; |
1160 | 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; |
1161 | void refresh_check (); |
1115 | void refresh_check (); |
1162 | void flush (); |
1116 | void flush (); |
… | |
… | |
1273 | void init_command (const char *const *argv); |
1227 | void init_command (const char *const *argv); |
1274 | void run_command (const char *const *argv); |
1228 | void run_command (const char *const *argv); |
1275 | int run_child (const char *const *argv); |
1229 | int run_child (const char *const *argv); |
1276 | void color_aliases (int idx); |
1230 | void color_aliases (int idx); |
1277 | void create_windows (int argc, const char *const *argv); |
1231 | void create_windows (int argc, const char *const *argv); |
1278 | void Get_Colours (); |
1232 | void get_colours (); |
1279 | void get_ourmods (); |
1233 | void get_ourmods (); |
1280 | // main.C |
1234 | // main.C |
1281 | void tt_winch (); |
1235 | void tt_winch (); |
1282 | rxvt_term (); |
1236 | rxvt_term (); |
1283 | ~rxvt_term (); |
1237 | ~rxvt_term (); |
… | |
… | |
1376 | options[opt >> 3] |= (1 << (opt & 7)); |
1330 | options[opt >> 3] |= (1 << (opt & 7)); |
1377 | else |
1331 | else |
1378 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1332 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1379 | } |
1333 | } |
1380 | |
1334 | |
1381 | void PrivMode (int set, unsigned bit) NOTHROW |
1335 | void set_privmode (unsigned bit, int set) NOTHROW |
1382 | { |
1336 | { |
1383 | if (set) |
1337 | if (set) |
1384 | priv_modes |= bit; |
1338 | priv_modes |= bit; |
1385 | else |
1339 | else |
1386 | priv_modes &= ~bit; |
1340 | priv_modes &= ~bit; |
… | |
… | |
1462 | void selection_send (const XSelectionRequestEvent &rq) NOTHROW; |
1416 | void selection_send (const XSelectionRequestEvent &rq) NOTHROW; |
1463 | void selection_click (int clicks, int x, int y) NOTHROW; |
1417 | void selection_click (int clicks, int x, int y) NOTHROW; |
1464 | void selection_extend (int x, int y, int flag) NOTHROW; |
1418 | void selection_extend (int x, int y, int flag) NOTHROW; |
1465 | void selection_rotate (int x, int y) NOTHROW; |
1419 | void selection_rotate (int x, int y) NOTHROW; |
1466 | |
1420 | |
1467 | #if defined(NEXT_SCROLLBAR) |
|
|
1468 | // scrollbar-next.C |
|
|
1469 | Pixmap renderPixmap (const char *const *data, int width, int height); |
|
|
1470 | void init_scrollbar_stuff (); |
|
|
1471 | void drawBevel (Drawable d, int x1, int y1, int w, int h); |
|
|
1472 | int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1473 | #endif |
|
|
1474 | |
|
|
1475 | #if defined(RXVT_SCROLLBAR) |
|
|
1476 | // scrollbar-rxvt.C |
|
|
1477 | int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1478 | #endif |
|
|
1479 | |
|
|
1480 | #if defined(XTERM_SCROLLBAR) |
|
|
1481 | // scrollbar-xterm.C |
|
|
1482 | int scrollbar_show_xterm (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1483 | #endif |
|
|
1484 | |
|
|
1485 | #if defined(PLAIN_SCROLLBAR) |
|
|
1486 | // scrollbar-plain.C |
|
|
1487 | int scrollbar_show_plain (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1488 | #endif |
|
|
1489 | |
|
|
1490 | // scrollbar.C |
|
|
1491 | void resize_scrollbar (); |
|
|
1492 | int scrollbar_mapping (int map); |
|
|
1493 | int scrollbar_show (int update); |
|
|
1494 | void setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness); |
|
|
1495 | |
|
|
1496 | // xdefaults.C |
1421 | // xdefaults.C |
1497 | void get_options (int argc, const char *const *argv); |
1422 | void get_options (int argc, const char *const *argv); |
1498 | int parse_keysym (const char *str, const char *arg); |
1423 | int parse_keysym (const char *str, const char *arg); |
1499 | const char *x_resource (const char *name); |
1424 | const char *x_resource (const char *name); |
1500 | void extract_resources (); |
1425 | void extract_resources (); |