… | |
… | |
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 | |
… | |
… | |
267 | #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) |
258 | #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) |
268 | # define NO_MOUSE_REPORT_SCROLLBAR 1 |
259 | # define NO_MOUSE_REPORT_SCROLLBAR 1 |
269 | #endif |
260 | #endif |
270 | |
261 | |
271 | #define scrollBar_esc 30 |
262 | #define scrollBar_esc 30 |
272 | |
|
|
273 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
|
|
274 | # define HAVE_SCROLLBARS 1 |
|
|
275 | #endif |
|
|
276 | |
263 | |
277 | #if !defined (RXVT_SCROLLBAR) && !defined (NEXT_SCROLLBAR) |
264 | #if !defined (RXVT_SCROLLBAR) && !defined (NEXT_SCROLLBAR) |
278 | # define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1 |
265 | # define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1 |
279 | #endif |
266 | #endif |
280 | |
267 | |
… | |
… | |
432 | URxvt_boldItalicFont = 713, |
419 | URxvt_boldItalicFont = 713, |
433 | |
420 | |
434 | URxvt_view_up = 720, |
421 | URxvt_view_up = 720, |
435 | URxvt_view_down = 721, |
422 | URxvt_view_down = 721, |
436 | |
423 | |
437 | URxvt_perl = 777, |
424 | URxvt_perl = 777, // for use by perl extensions, starts with "extension-name;" |
438 | }; |
425 | }; |
439 | |
426 | |
440 | /* Words starting with `Color_' are colours. Others are counts */ |
427 | /* Words starting with `Color_' are colours. Others are counts */ |
441 | /* |
428 | /* |
442 | * The PixColor and rendition colour usage should probably be decoupled |
429 | * The PixColor and rendition colour usage should probably be decoupled |
… | |
… | |
492 | Color_underline, |
479 | Color_underline, |
493 | #endif |
480 | #endif |
494 | #ifdef OPTION_HC |
481 | #ifdef OPTION_HC |
495 | Color_HC, |
482 | Color_HC, |
496 | #endif |
483 | #endif |
497 | #ifdef HAVE_SCROLLBARS |
|
|
498 | Color_scroll, |
484 | Color_scroll, |
499 | #endif |
|
|
500 | #ifdef RXVT_SCROLLBAR |
485 | #ifdef RXVT_SCROLLBAR |
501 | Color_trough, |
486 | Color_trough, |
502 | #endif |
487 | #endif |
503 | #if ENABLE_TRANSPARENCY |
488 | #if ENABLE_TRANSPARENCY |
504 | Color_tint, |
489 | Color_tint, |
… | |
… | |
565 | |
550 | |
566 | // do not change these constants lightly, there are many interdependencies |
551 | // do not change these constants lightly, there are many interdependencies |
567 | #define IMBUFSIZ 128 // input modifier buffer sizes |
552 | #define IMBUFSIZ 128 // input modifier buffer sizes |
568 | #define KBUFSZ 512 // size of keyboard mapping buffer |
553 | #define KBUFSZ 512 // size of keyboard mapping buffer |
569 | #define CBUFSIZ 2048 // size of command buffer |
554 | #define CBUFSIZ 2048 // size of command buffer |
|
|
555 | #define CBUFCNT 8 // never call pty_fill/cmd_parse more than this often in a row |
570 | #define UBUFSIZ 2048 // character buffer |
556 | #define UBUFSIZ 2048 // character buffer |
571 | |
557 | |
572 | #if ENABLE_FRILLS |
558 | #if ENABLE_FRILLS |
573 | # include <X11/Xmd.h> |
559 | # include <X11/Xmd.h> |
574 | typedef struct _mwmhints { |
560 | typedef struct _mwmhints { |
… | |
… | |
816 | * +------------+·display·+·= term_start |
802 | * +------------+·display·+·= term_start |
817 | * | terminal | display | |
803 | * | terminal | display | |
818 | * | terminal +---------+ |
804 | * | terminal +---------+ |
819 | * | terminal | |
805 | * | terminal | |
820 | * | terminal | |
806 | * | terminal | |
821 | * +------------+···········= term_stat + nrow - 1 |
807 | * +------------+···········= term_start + nrow - 1 |
822 | * | |
808 | * | |
823 | * | |
809 | * | |
824 | * END······················= total_rows |
810 | * END······················= total_rows |
825 | */ |
811 | */ |
826 | |
812 | |
… | |
… | |
862 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
848 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
863 | * nothing is selected |
849 | * nothing is selected |
864 | * beg: row/column of beginning of selection : never past mark |
850 | * beg: row/column of beginning of selection : never past mark |
865 | * mark: row/column of initial click : never past end |
851 | * mark: row/column of initial click : never past end |
866 | * end: row/column of one character past end of selection |
852 | * end: row/column of one character past end of selection |
867 | * * Note: -nsaved <= beg.row <= mark.row <= end.row < nrow |
853 | * * Note: top_row <= beg.row <= mark.row <= end.row < nrow |
868 | * * Note: col == -1 ==> we're left of screen |
854 | * * Note: col == -1 ==> we're left of screen |
869 | * |
855 | * |
870 | */ |
856 | */ |
871 | typedef struct { |
857 | typedef struct { |
872 | row_col_t cur; /* cursor position on the screen */ |
858 | row_col_t cur; /* cursor position on the screen */ |
… | |
… | |
958 | |
944 | |
959 | unsigned char want_refresh:1, |
945 | unsigned char want_refresh:1, |
960 | current_screen:1, /* primary or secondary */ |
946 | current_screen:1, /* primary or secondary */ |
961 | num_scr_allow:1, |
947 | num_scr_allow:1, |
962 | bypass_keystate:1, |
948 | bypass_keystate:1, |
|
|
949 | #ifdef ENABLE_FRILLS |
|
|
950 | urgency_hint:1, |
|
|
951 | #endif |
963 | #ifdef CURSOR_BLINK |
952 | #ifdef CURSOR_BLINK |
964 | hidden_cursor:1, |
953 | hidden_cursor:1, |
965 | #endif |
954 | #endif |
966 | #ifdef TEXT_BLINK |
955 | #ifdef TEXT_BLINK |
967 | hidden_text:1, |
956 | hidden_text:1, |
… | |
… | |
1005 | mouse_slip_wheel_speed, |
994 | mouse_slip_wheel_speed, |
1006 | #endif |
995 | #endif |
1007 | refresh_count, |
996 | refresh_count, |
1008 | window_vt_x, |
997 | window_vt_x, |
1009 | window_vt_y, |
998 | window_vt_y, |
1010 | window_sb_x, |
|
|
1011 | mouse_row, |
999 | mouse_row, |
1012 | mouse_col, |
1000 | mouse_col, |
1013 | # ifdef POINTER_BLANK |
1001 | # ifdef POINTER_BLANK |
1014 | pointerBlankDelay, |
1002 | pointerBlankDelay, |
1015 | # endif |
1003 | # endif |
… | |
… | |
1023 | unsigned long priv_modes, |
1011 | unsigned long priv_modes, |
1024 | SavedModes; |
1012 | SavedModes; |
1025 | /* ---------- */ |
1013 | /* ---------- */ |
1026 | Atom *xa; |
1014 | Atom *xa; |
1027 | /* ---------- */ |
1015 | /* ---------- */ |
1028 | #ifdef RXVT_SCROLLBAR |
|
|
1029 | GC scrollbarGC, |
|
|
1030 | topShadowGC, |
|
|
1031 | botShadowGC; |
|
|
1032 | #endif |
|
|
1033 | #ifdef XTERM_SCROLLBAR |
|
|
1034 | GC xscrollbarGC, |
|
|
1035 | ShadowGC; |
|
|
1036 | #endif |
|
|
1037 | #ifdef PLAIN_SCROLLBAR |
|
|
1038 | GC pscrollbarGC; |
|
|
1039 | #endif |
|
|
1040 | #ifdef NEXT_SCROLLBAR |
|
|
1041 | GC blackGC, |
|
|
1042 | whiteGC, |
|
|
1043 | grayGC, |
|
|
1044 | darkGC, |
|
|
1045 | stippleGC; |
|
|
1046 | Pixmap dimple, |
|
|
1047 | upArrow, |
|
|
1048 | downArrow, |
|
|
1049 | upArrowHi, |
|
|
1050 | downArrowHi; |
|
|
1051 | #endif |
|
|
1052 | /* ---------- */ |
|
|
1053 | Time selection_time, |
1016 | Time selection_time, |
1054 | selection_request_time; |
1017 | selection_request_time; |
1055 | pid_t cmd_pid; /* process id of child */ |
1018 | pid_t cmd_pid; /* process id of child */ |
1056 | char * incr_buf; |
1019 | char * incr_buf; |
1057 | size_t incr_buf_size, incr_buf_fill; |
1020 | size_t incr_buf_size, incr_buf_fill; |
… | |
… | |
1064 | bgPixmap_t bgPixmap; |
1027 | bgPixmap_t bgPixmap; |
1065 | #endif |
1028 | #endif |
1066 | #ifdef HAVE_AFTERIMAGE |
1029 | #ifdef HAVE_AFTERIMAGE |
1067 | ASVisual *asv; |
1030 | ASVisual *asv; |
1068 | ASImageManager *asimman; |
1031 | ASImageManager *asimman; |
|
|
1032 | |
|
|
1033 | void init_asv () |
|
|
1034 | { |
|
|
1035 | if (!asv) |
|
|
1036 | asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); |
|
|
1037 | } |
1069 | #endif |
1038 | #endif |
1070 | |
1039 | |
1071 | #if ENABLE_OVERLAY |
1040 | #if ENABLE_OVERLAY |
1072 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1041 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1073 | text_t **ov_text; |
1042 | text_t **ov_text; |
… | |
… | |
1117 | |
1086 | |
1118 | #if ENABLE_FRILLS || ISO_14755 |
1087 | #if ENABLE_FRILLS || ISO_14755 |
1119 | // ISO 14755 entry support |
1088 | // ISO 14755 entry support |
1120 | unicode_t iso14755buf; |
1089 | unicode_t iso14755buf; |
1121 | void commit_iso14755 (); |
1090 | void commit_iso14755 (); |
1122 | int hex_keyval (XKeyEvent &ev); |
|
|
1123 | # if ISO_14755 |
1091 | # if ISO_14755 |
1124 | void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE, int x = 0, int y = -1); |
1092 | void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE, int x = 0, int y = -1); |
1125 | void iso14755_54 (int x, int y); |
1093 | void iso14755_54 (int x, int y); |
1126 | # endif |
1094 | # endif |
1127 | #endif |
1095 | #endif |
… | |
… | |
1148 | #endif |
1116 | #endif |
1149 | |
1117 | |
1150 | void x_cb (XEvent &xev); |
1118 | void x_cb (XEvent &xev); |
1151 | xevent_watcher termwin_ev; |
1119 | xevent_watcher termwin_ev; |
1152 | xevent_watcher vt_ev; |
1120 | xevent_watcher vt_ev; |
1153 | #ifdef HAVE_SCROLLBARS |
|
|
1154 | xevent_watcher scrollbar_ev; |
1121 | xevent_watcher scrollbar_ev; |
1155 | #endif |
|
|
1156 | |
1122 | |
1157 | void child_cb (ev::child &w, int revents); ev::child child_ev; |
1123 | void child_cb (ev::child &w, int revents); ev::child child_ev; |
1158 | void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; |
1124 | void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; |
1159 | void refresh_check (); |
1125 | void refresh_check (); |
1160 | void flush (); |
1126 | void flush (); |
… | |
… | |
1233 | wchar_t next_char () NOTHROW; |
1199 | wchar_t next_char () NOTHROW; |
1234 | wchar_t cmd_getc () THROW ((class out_of_input)); |
1200 | wchar_t cmd_getc () THROW ((class out_of_input)); |
1235 | uint32_t next_octet () NOTHROW; |
1201 | uint32_t next_octet () NOTHROW; |
1236 | uint32_t cmd_get8 () THROW ((class out_of_input)); |
1202 | uint32_t cmd_get8 () THROW ((class out_of_input)); |
1237 | |
1203 | |
1238 | bool cmd_parse (); |
1204 | void cmd_parse (); |
1239 | void mouse_report (XButtonEvent &ev); |
1205 | void mouse_report (XButtonEvent &ev); |
1240 | void button_press (XButtonEvent &ev); |
1206 | void button_press (XButtonEvent &ev); |
1241 | void button_release (XButtonEvent &ev); |
1207 | void button_release (XButtonEvent &ev); |
1242 | void focus_in (); |
1208 | void focus_in (); |
1243 | void focus_out (); |
1209 | void focus_out (); |
|
|
1210 | void set_urgency (bool enable); |
1244 | void update_fade_color (unsigned int idx); |
1211 | void update_fade_color (unsigned int idx); |
1245 | #ifdef PRINTPIPE |
1212 | #ifdef PRINTPIPE |
1246 | FILE *popen_printer (); |
1213 | FILE *popen_printer (); |
1247 | int pclose_printer (FILE *stream); |
1214 | int pclose_printer (FILE *stream); |
1248 | #endif |
1215 | #endif |
… | |
… | |
1271 | void init_command (const char *const *argv); |
1238 | void init_command (const char *const *argv); |
1272 | void run_command (const char *const *argv); |
1239 | void run_command (const char *const *argv); |
1273 | int run_child (const char *const *argv); |
1240 | int run_child (const char *const *argv); |
1274 | void color_aliases (int idx); |
1241 | void color_aliases (int idx); |
1275 | void create_windows (int argc, const char *const *argv); |
1242 | void create_windows (int argc, const char *const *argv); |
1276 | void Get_Colours (); |
1243 | void get_colours (); |
1277 | void get_ourmods (); |
1244 | void get_ourmods (); |
1278 | // main.C |
1245 | // main.C |
1279 | void tt_winch (); |
1246 | void tt_winch (); |
1280 | rxvt_term (); |
1247 | rxvt_term (); |
1281 | ~rxvt_term (); |
1248 | ~rxvt_term (); |
… | |
… | |
1374 | options[opt >> 3] |= (1 << (opt & 7)); |
1341 | options[opt >> 3] |= (1 << (opt & 7)); |
1375 | else |
1342 | else |
1376 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1343 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1377 | } |
1344 | } |
1378 | |
1345 | |
1379 | void PrivMode (int set, unsigned bit) NOTHROW |
1346 | void set_privmode (unsigned bit, int set) NOTHROW |
1380 | { |
1347 | { |
1381 | if (set) |
1348 | if (set) |
1382 | priv_modes |= bit; |
1349 | priv_modes |= bit; |
1383 | else |
1350 | else |
1384 | priv_modes &= ~bit; |
1351 | priv_modes &= ~bit; |
… | |
… | |
1386 | |
1353 | |
1387 | // modifies first argument(!) |
1354 | // modifies first argument(!) |
1388 | void paste (char *data, unsigned int len) NOTHROW; |
1355 | void paste (char *data, unsigned int len) NOTHROW; |
1389 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1356 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1390 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1357 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
|
|
1358 | void scr_kill_char (line_t &l, int col) const NOTHROW; |
1391 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
1359 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
1392 | void scr_reset (); |
1360 | void scr_reset (); |
1393 | void scr_release () NOTHROW; |
1361 | void scr_release () NOTHROW; |
1394 | void scr_clear (bool really = false) NOTHROW; |
1362 | void scr_clear (bool really = false) NOTHROW; |
1395 | void scr_refresh () NOTHROW; |
1363 | void scr_refresh () NOTHROW; |
… | |
… | |
1460 | void selection_send (const XSelectionRequestEvent &rq) NOTHROW; |
1428 | void selection_send (const XSelectionRequestEvent &rq) NOTHROW; |
1461 | void selection_click (int clicks, int x, int y) NOTHROW; |
1429 | void selection_click (int clicks, int x, int y) NOTHROW; |
1462 | void selection_extend (int x, int y, int flag) NOTHROW; |
1430 | void selection_extend (int x, int y, int flag) NOTHROW; |
1463 | void selection_rotate (int x, int y) NOTHROW; |
1431 | void selection_rotate (int x, int y) NOTHROW; |
1464 | |
1432 | |
1465 | #if defined(NEXT_SCROLLBAR) |
|
|
1466 | // scrollbar-next.C |
|
|
1467 | Pixmap renderPixmap (const char *const *data, int width, int height); |
|
|
1468 | void init_scrollbar_stuff (); |
|
|
1469 | void drawBevel (Drawable d, int x1, int y1, int w, int h); |
|
|
1470 | int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1471 | #endif |
|
|
1472 | |
|
|
1473 | #if defined(RXVT_SCROLLBAR) |
|
|
1474 | // scrollbar-rxvt.C |
|
|
1475 | int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1476 | #endif |
|
|
1477 | |
|
|
1478 | #if defined(XTERM_SCROLLBAR) |
|
|
1479 | // scrollbar-xterm.C |
|
|
1480 | int scrollbar_show_xterm (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1481 | #endif |
|
|
1482 | |
|
|
1483 | #if defined(PLAIN_SCROLLBAR) |
|
|
1484 | // scrollbar-plain.C |
|
|
1485 | int scrollbar_show_plain (int update, int last_top, int last_bot, int scrollbar_len); |
|
|
1486 | #endif |
|
|
1487 | |
|
|
1488 | // scrollbar.C |
|
|
1489 | void resize_scrollbar (); |
|
|
1490 | int scrollbar_mapping (int map); |
|
|
1491 | int scrollbar_show (int update); |
|
|
1492 | void setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness); |
|
|
1493 | |
|
|
1494 | // xdefaults.C |
1433 | // xdefaults.C |
1495 | void get_options (int argc, const char *const *argv); |
1434 | void get_options (int argc, const char *const *argv); |
1496 | int parse_keysym (const char *str, const char *arg); |
1435 | int parse_keysym (const char *str, const char *arg); |
1497 | const char *x_resource (const char *name); |
1436 | const char *x_resource (const char *name); |
1498 | void extract_resources (); |
1437 | void extract_resources (); |