1 | /* |
1 | /* |
2 | * $Id: rxvt.h,v 1.5 2003/11/25 15:44:39 pcg Exp $ |
2 | * $Id: rxvt.h,v 1.13 2003/12/18 00:29:29 pcg Exp $ |
3 | */ |
3 | */ |
4 | |
4 | |
5 | #ifndef _RXVT_H_ /* include once only */ |
5 | #ifndef _RXVT_H_ /* include once only */ |
6 | #define _RXVT_H_ |
6 | #define _RXVT_H_ |
7 | |
7 | |
… | |
… | |
15 | #include <X11/Xatom.h> |
15 | #include <X11/Xatom.h> |
16 | |
16 | |
17 | #include "defaultfont.h" |
17 | #include "defaultfont.h" |
18 | #include "rxvtcolor.h" |
18 | #include "rxvtcolor.h" |
19 | #include "iom.h" |
19 | #include "iom.h" |
|
|
20 | #include "salloc.h" |
20 | |
21 | |
21 | /* |
22 | /* |
22 | ***************************************************************************** |
23 | ***************************************************************************** |
23 | * SYSTEM HACKS |
24 | * SYSTEM HACKS |
24 | ***************************************************************************** |
25 | ***************************************************************************** |
… | |
… | |
551 | Rs_answerbackstring, |
552 | Rs_answerbackstring, |
552 | Rs_tripleclickwords, |
553 | Rs_tripleclickwords, |
553 | Rs_cursorBlink, |
554 | Rs_cursorBlink, |
554 | Rs_pointerBlank, |
555 | Rs_pointerBlank, |
555 | Rs_pointerBlankDelay, |
556 | Rs_pointerBlankDelay, |
|
|
557 | Rs_imLocale, |
556 | NUM_RESOURCES |
558 | NUM_RESOURCES |
557 | }; |
|
|
558 | |
|
|
559 | enum { |
|
|
560 | TIMEOUT_INCR = 0, |
|
|
561 | NUM_TIMEOUTS |
|
|
562 | }; |
559 | }; |
563 | |
560 | |
564 | enum { |
561 | enum { |
565 | XA_COMPOUND_TEXT = 0, |
562 | XA_COMPOUND_TEXT = 0, |
566 | XA_MULTIPLE, |
563 | XA_MULTIPLE, |
… | |
… | |
854 | } |
851 | } |
855 | }; |
852 | }; |
856 | |
853 | |
857 | struct rxvt_term : rxvt_vars { |
854 | struct rxvt_term : rxvt_vars { |
858 | struct mbstate mbstate; |
855 | struct mbstate mbstate; |
859 | #ifdef __GNUC__ |
856 | |
860 | unsigned char want_refresh:1, |
857 | unsigned char want_refresh:1, |
861 | want_full_refresh:1, |
858 | #ifdef TRANSPARENT |
862 | am_transparent:1, |
859 | want_full_refresh:1, /* awaiting full screen refresh */ |
863 | am_pixmap_trans:1, |
860 | #endif |
864 | current_screen:1, |
861 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
865 | hate_those_clicks:1, |
862 | am_transparent:1, /* is a transparent term */ |
|
|
863 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
|
|
864 | #endif |
|
|
865 | current_screen:1, /* primary or secondary */ |
|
|
866 | hate_those_clicks:1, /* a.k.a. keep mark position */ |
866 | num_scr_allow:1, |
867 | num_scr_allow:1, |
867 | bypass_keystate:1; |
868 | bypass_keystate:1, |
868 | unsigned char chstat:1, |
869 | #ifdef CURSOR_BLINK |
869 | lost_multi:1, |
|
|
870 | multi_byte:1, |
|
|
871 | hidden_cursor:1, |
870 | hidden_cursor:1, |
|
|
871 | #endif |
|
|
872 | #ifdef POINTER_BLANK |
872 | hidden_pointer:1, |
873 | hidden_pointer:1, |
|
|
874 | #endif |
873 | parsed_geometry:1; |
875 | parsed_geometry:1, |
874 | #else |
876 | seen_input:1; /* wether any input has been seen so far */ |
875 | unsigned char want_refresh, |
|
|
876 | # ifdef TRANSPARENT |
|
|
877 | want_full_refresh, /* awaiting full screen refresh */ |
|
|
878 | # endif |
|
|
879 | # if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
880 | am_transparent, /* is a transparent term */ |
|
|
881 | am_pixmap_trans, /* transparency w/known root pixmap */ |
|
|
882 | # endif |
|
|
883 | current_screen, /* primary or secondary */ |
|
|
884 | hate_those_clicks, /* a.k.a. keep mark position */ |
|
|
885 | num_scr_allow, |
|
|
886 | bypass_keystate, |
|
|
887 | # ifdef MULTICHAR_SET |
|
|
888 | chstat, |
|
|
889 | lost_multi, /* set ==> we only got half a glyph */ |
|
|
890 | multi_byte, /* set ==> currently using 2 bytes per glyph */ |
|
|
891 | # endif |
|
|
892 | # ifdef CURSOR_BLINK |
|
|
893 | hidden_cursor, |
|
|
894 | # endif |
|
|
895 | # ifdef POINTER_BLANK |
|
|
896 | hidden_pointer, |
|
|
897 | # endif |
|
|
898 | parsed_geometry; |
|
|
899 | #endif /* !__GNUC__ */ |
|
|
900 | |
877 | |
901 | unsigned char refresh_type, |
878 | unsigned char refresh_type, |
902 | #ifdef UTMP_SUPPORT |
879 | #ifdef UTMP_SUPPORT |
903 | next_utmp_action, |
880 | next_utmp_action, |
904 | #endif |
881 | #endif |
… | |
… | |
956 | currmaxcol, |
933 | currmaxcol, |
957 | #ifdef MENUBAR |
934 | #ifdef MENUBAR |
958 | menu_readonly, /* okay to alter menu? */ |
935 | menu_readonly, /* okay to alter menu? */ |
959 | Arrows_x, |
936 | Arrows_x, |
960 | #endif |
937 | #endif |
961 | #if (MENUBAR_MAX > 1) |
938 | #if MENUBAR_MAX > 1 |
962 | Nbars, |
939 | Nbars, |
963 | #endif |
940 | #endif |
964 | window_vt_x, |
941 | window_vt_x, |
965 | window_vt_y, |
942 | window_vt_y, |
966 | window_sb_x, |
943 | window_sb_x, |
… | |
… | |
1018 | #if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && !defined(__CYGWIN32__) |
995 | #if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && !defined(__CYGWIN32__) |
1019 | uid_t euid; |
996 | uid_t euid; |
1020 | gid_t egid; |
997 | gid_t egid; |
1021 | #endif |
998 | #endif |
1022 | /* ---------- */ |
999 | /* ---------- */ |
1023 | Cursor pointer_leftptr; |
1000 | Cursor leftptr_cursor; |
1024 | #ifdef POINTER_BLANK |
1001 | #ifdef POINTER_BLANK |
1025 | Cursor pointer_blank; |
1002 | Cursor blank_cursor; |
1026 | #endif |
1003 | #endif |
1027 | /* ---------- */ |
1004 | /* ---------- */ |
1028 | const char *ttydev; /* pty/tty name */ |
1005 | const char *ttydev; /* pty/tty name */ |
1029 | #ifndef NO_BACKSPACE_KEY |
1006 | #ifndef NO_BACKSPACE_KEY |
1030 | const char *key_backspace; |
1007 | const char *key_backspace; |
… | |
… | |
1089 | struct timeval lastcursorchange; |
1066 | struct timeval lastcursorchange; |
1090 | #endif |
1067 | #endif |
1091 | #ifdef POINTER_BLANK |
1068 | #ifdef POINTER_BLANK |
1092 | struct timeval lastmotion; |
1069 | struct timeval lastmotion; |
1093 | #endif |
1070 | #endif |
1094 | struct timeval timeout[NUM_TIMEOUTS]; |
|
|
1095 | |
1071 | |
1096 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1072 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1097 | char *env_windowid; /* environmental variable WINDOWID */ |
1073 | char *env_windowid; /* environmental variable WINDOWID */ |
1098 | char *env_display; /* environmental variable DISPLAY */ |
1074 | char *env_display; /* environmental variable DISPLAY */ |
1099 | char *env_term; /* environmental variable TERM */ |
1075 | char *env_term; /* environmental variable TERM */ |
1100 | char *env_colorfgbg; |
1076 | char *env_colorfgbg; |
1101 | char *buffer; |
1077 | char *buffer; |
1102 | char *locale; |
1078 | char *locale; |
1103 | char charsets[4]; |
1079 | char charsets[4]; |
1104 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1080 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1105 | unsigned char *v_bufstr; /* beginning of area to write */ |
|
|
1106 | unsigned char *v_bufptr; /* end of area to write */ |
1081 | unsigned int v_buflen; /* size of area to write */ |
1107 | unsigned char *v_bufend; /* end of physical buffer */ |
|
|
1108 | char *newfont[MAX_NFONTS]; |
1082 | char *newfont[MAX_NFONTS]; |
1109 | #ifdef KEYSYM_RESOURCE |
1083 | #ifdef KEYSYM_RESOURCE |
1110 | const unsigned char *Keysym_map[256]; |
1084 | const unsigned char *Keysym_map[256]; |
1111 | #endif |
1085 | #endif |
1112 | const char *rs[NUM_RESOURCES]; |
1086 | const char *rs[NUM_RESOURCES]; |
1113 | /* command input buffering */ |
1087 | /* command input buffering */ |
1114 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1088 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1115 | unsigned char cmdbuf_base[BUFSIZ]; |
1089 | unsigned char cmdbuf_base[BUFSIZ]; |
1116 | unsigned char kbuf[KBUFSZ]; |
1090 | unsigned char kbuf[KBUFSZ]; |
1117 | |
1091 | |
|
|
1092 | rxvt_salloc *ralloc; |
|
|
1093 | rxvt_salloc *talloc; |
|
|
1094 | |
|
|
1095 | void paste (const unsigned char *data, unsigned int len); |
|
|
1096 | |
|
|
1097 | void flush (); |
|
|
1098 | |
|
|
1099 | void check_cb (check_watcher &w); check_watcher check_ev; |
|
|
1100 | void destroy_cb (time_watcher &w); time_watcher destroy_ev; |
|
|
1101 | |
1118 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1102 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1119 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1103 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1120 | |
1104 | |
|
|
1105 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
|
|
1106 | |
1121 | #ifdef CURSOR_BLINK |
1107 | #ifdef CURSOR_BLINK |
1122 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1108 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1123 | #endif |
1109 | #endif |
1124 | |
1110 | |
1125 | void flush (); |
1111 | #ifdef POINTER_BLANK |
|
|
1112 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
|
|
1113 | void pointer_blank (); |
|
|
1114 | void pointer_unblank (); |
|
|
1115 | #endif |
|
|
1116 | |
|
|
1117 | void tt_printf (const char *fmt,...); |
|
|
1118 | void tt_write (const unsigned char *data, unsigned int len); |
|
|
1119 | |
|
|
1120 | void tt_winch (); |
1126 | |
1121 | |
1127 | rxvt_term (); |
1122 | rxvt_term (); |
1128 | ~rxvt_term (); |
1123 | ~rxvt_term (); |
|
|
1124 | void destroy (); |
1129 | |
1125 | |
1130 | bool init (int argc, const char *const *argv); |
1126 | bool init (int argc, const char *const *argv); |
1131 | bool init_vars (); |
1127 | bool init_vars (); |
1132 | |
1128 | |
1133 | uint32_t next_char (); |
1129 | uint32_t next_char (); |
1134 | |
1130 | |
1135 | bool pty_fill (size_t count); |
1131 | bool pty_fill (); |
1136 | void process_x_events (); |
1132 | void process_x_events (); |
1137 | |
1133 | |
1138 | void *operator new (size_t s); |
1134 | void *operator new (size_t s); |
1139 | void operator delete (void *p, size_t s); |
1135 | void operator delete (void *p, size_t s); |
|
|
1136 | |
|
|
1137 | /* screen(!) */ |
|
|
1138 | void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs); |
|
|
1139 | void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); |
|
|
1140 | int scr_scroll_text (int row1, int row2, int count, int spec); |
|
|
1141 | void scr_reset (); |
|
|
1142 | void scr_reset_realloc (); |
|
|
1143 | void scr_release (); |
1140 | }; |
1144 | }; |
1141 | |
1145 | |
1142 | #ifndef __attribute__ |
1146 | #ifndef __attribute__ |
1143 | # ifdef __GNUC__ |
1147 | # ifdef __GNUC__ |
1144 | # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) |
1148 | # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) |